diff options
Diffstat (limited to 'files/zh-cn/web/svg/attribute/stroke-linecap/index.html')
| -rw-r--r-- | files/zh-cn/web/svg/attribute/stroke-linecap/index.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/files/zh-cn/web/svg/attribute/stroke-linecap/index.html b/files/zh-cn/web/svg/attribute/stroke-linecap/index.html new file mode 100644 index 0000000000..8233fd5eda --- /dev/null +++ b/files/zh-cn/web/svg/attribute/stroke-linecap/index.html @@ -0,0 +1,72 @@ +--- +title: stroke-linecap +slug: Web/SVG/Attribute/stroke-linecap +tags: + - SVG + - SVG 属性 +translation_of: Web/SVG/Attribute/stroke-linecap +--- +<p>« <a href="/en-US/docs/Web/SVG/Attribute" title="en-US/docs/Web/SVG/Attribute">SVG 属性 参照主页</a></p> + +<p><code>stroke-linecap</code> 属性制定了,在开放子路径被设置描边的情况下,用于开放自路径两端的形状。</p> + +<p>作为一个展现属性,它也可以在一个CSS样式表内部,作为一个属性直接使用。</p> + +<h2 id="使用背景">使用背景</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="row">分类</th> + <td>展现属性</td> + </tr> + <tr> + <th scope="row">属性值</th> + <td>butt | round | square | inherit</td> + </tr> + <tr> + <th scope="row">可动画化</th> + <td>是</td> + </tr> + <tr> + <th scope="row">规范文档</th> + <td><a class="external" href="http://www.w3.org/TR/SVG/painting.html#StrokeLinecapProperty" title="http://www.w3.org/TR/SVG/painting.html#StrokeLinecapProperty">SVG 1.1 (2nd Edition)</a></td> + </tr> + </tbody> +</table> + +<h2 id="Example">Example</h2> + +<pre class="brush: html"><?xml version="1.0"?> +<svg width="120" height="120" + viewPort="0 0 120 120" version="1.1" + xmlns="http://www.w3.org/2000/svg"> + + <line stroke-linecap="butt" + x1="30" y1="30" x2="30" y2="90" + stroke="black" stroke-width="20"/> + + <line stroke-linecap="round" + x1="60" y1="30" x2="60" y2="90" + stroke="black" stroke-width="20"/> + + <line stroke-linecap="square" + x1="90" y1="30" x2="90" y2="90" + stroke="black" stroke-width="20"/> + + <path d="M30,30 L30,90 M60,30 L60,90 M90,30 L90,90" + stroke="white" /> +</svg></pre> + +<p><strong>实时样例</strong></p> + +<p>{{ EmbedLiveSample('Example','120','120') }}</p> + +<h2 id="元素">元素</h2> + +<p>以下元素可以使用<code>stroke-linecap</code> 属性</p> + +<ul> + <li><a href="/en-US/docs/Web/SVG/Element#Shape" title="en-US/docs/Web/SVG/Element#Shape">图形元素</a> »</li> + <li><a href="/en-US/docs/Web/SVG/Element#TextContent" title="en-US/docs/Web/SVG/Element#TextContent">文本内容元素</a> »</li> +</ul> |
