aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/svg/attribute/stroke-dasharray
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/svg/attribute/stroke-dasharray')
-rw-r--r--files/zh-cn/web/svg/attribute/stroke-dasharray/index.html79
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> | &lt;dasharray&gt; | 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>&lt;dasharray&gt;</dt>
+ <dd>它是一个<span><a href="/en/SVG/Content_type#Length" title="en/SVG/Content_type#Length">&lt;length&gt;</a>和</span><a href="/en/SVG/Content_type#Percentage" title="en/SVG/Content_type#Percentage">&lt;percentage&gt;</a>数列,数与数之间用逗号或者空白隔开,指定短划线和缺口的长度。如果提供了奇数个值,则这个值的数列重复一次,从而变成偶数个值。因此,<strong>5,3,2</strong>等同于<strong>5,3,2,5,3,2</strong>。</dd>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: html">&lt;?xml version="1.0"?&gt;
+&lt;svg width="200" height="200" viewPort="0 0 200 300" version="1.1" xmlns="http://www.w3.org/2000/svg"&gt;
+
+ &lt;line stroke-dasharray="5, 5" x1="10" y1="10" x2="190" y2="10" /&gt;
+ &lt;line stroke-dasharray="5, 10" x1="10" y1="30" x2="190" y2="30" /&gt;
+ &lt;line stroke-dasharray="10, 5" x1="10" y1="50" x2="190" y2="50" /&gt;
+ &lt;line stroke-dasharray="5, 1" x1="10" y1="70" x2="190" y2="70" /&gt;
+ &lt;line stroke-dasharray="1, 5" x1="10" y1="90" x2="190" y2="90" /&gt;
+ &lt;line stroke-dasharray="0.9" x1="10" y1="110" x2="190" y2="110" /&gt;
+ &lt;line stroke-dasharray="15, 10, 5" x1="10" y1="130" x2="190" y2="130" /&gt;
+ &lt;line stroke-dasharray="15, 10, 5, 10" x1="10" y1="150" x2="190" y2="150" /&gt;
+ &lt;line stroke-dasharray="15, 10, 5, 10, 15" x1="10" y1="170" x2="190" y2="170" /&gt;
+ &lt;line stroke-dasharray="5, 5, 1, 5" x1="10" y1="190" x2="190" y2="190" /&gt;
+
+&lt;style&gt;&lt;![CDATA[
+line{
+ stroke: black;
+ stroke-width: 2;
+}
+]]&gt;&lt;/style&gt;
+&lt;/svg&gt;</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>