diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/svg/attribute/stroke-dasharray | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/zh-cn/web/svg/attribute/stroke-dasharray')
| -rw-r--r-- | files/zh-cn/web/svg/attribute/stroke-dasharray/index.html | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/files/zh-cn/web/svg/attribute/stroke-dasharray/index.html b/files/zh-cn/web/svg/attribute/stroke-dasharray/index.html new file mode 100644 index 0000000000..9ecc44d9dc --- /dev/null +++ b/files/zh-cn/web/svg/attribute/stroke-dasharray/index.html @@ -0,0 +1,79 @@ +--- +title: stroke-dasharray +slug: Web/SVG/Attribute/stroke-dasharray +tags: + - SVG + - SVG属性 + - 需要兼容性表 +translation_of: Web/SVG/Attribute/stroke-dasharray +--- +<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG属性参考主页</a></p> + +<p><code><font face="Open Sans, Arial, sans-serif">属性</font>stroke-dasharray可</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><strong title="this is the default value">none</strong> | <dasharray> | inherit</td> + </tr> + <tr> + <th scope="row">可变性</th> + <td>Yes</td> + </tr> + <tr> + <th scope="row">规范文档</th> + <td><a class="external" href="http://www.w3.org/TR/SVG/painting.html#StrokeDasharrayProperty" title="http://www.w3.org/TR/SVG/painting.html#StrokeDasharrayProperty">SVG 1.1 (2nd Edition)</a></td> + </tr> + </tbody> +</table> + +<dl> + <dt><dasharray></dt> + <dd>它是一个<span><a href="/en/SVG/Content_type#Length" title="en/SVG/Content_type#Length"><length></a>和</span><a href="/en/SVG/Content_type#Percentage" title="en/SVG/Content_type#Percentage"><percentage></a>数列,数与数之间用逗号或者空白隔开,指定短划线和缺口的长度。如果提供了奇数个值,则这个值的数列重复一次,从而变成偶数个值。因此,<strong>5,3,2</strong>等同于<strong>5,3,2,5,3,2</strong>。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<pre class="brush: html"><?xml version="1.0"?> +<svg width="200" height="200" viewPort="0 0 200 300" version="1.1" xmlns="http://www.w3.org/2000/svg"> + + <line stroke-dasharray="5, 5" x1="10" y1="10" x2="190" y2="10" /> + <line stroke-dasharray="5, 10" x1="10" y1="30" x2="190" y2="30" /> + <line stroke-dasharray="10, 5" x1="10" y1="50" x2="190" y2="50" /> + <line stroke-dasharray="5, 1" x1="10" y1="70" x2="190" y2="70" /> + <line stroke-dasharray="1, 5" x1="10" y1="90" x2="190" y2="90" /> + <line stroke-dasharray="0.9" x1="10" y1="110" x2="190" y2="110" /> + <line stroke-dasharray="15, 10, 5" x1="10" y1="130" x2="190" y2="130" /> + <line stroke-dasharray="15, 10, 5, 10" x1="10" y1="150" x2="190" y2="150" /> + <line stroke-dasharray="15, 10, 5, 10, 15" x1="10" y1="170" x2="190" y2="170" /> + <line stroke-dasharray="5, 5, 1, 5" x1="10" y1="190" x2="190" y2="190" /> + +<style><![CDATA[ +line{ + stroke: black; + stroke-width: 2; +} +]]></style> +</svg></pre> + +<p><strong>示例输出</strong></p> + +<p>{{ EmbedLiveSample('Example','220','220') }}</p> + +<h2 id="元素">元素</h2> + +<p>下列元素可以使用<code>stroke-dasharray属性:</code></p> + +<ul> + <li><a href="/en/SVG/Element#Shape_elements" title="en/SVG/Element#Shape_elements">形状元素</a> »</li> + <li><a href="/en/SVG/Element#Text_content_elements" title="en/SVG/Element#Text_content_elements">文本内容元素</a> »</li> +</ul> |
