aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/svg/attribute/letter-spacing/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/svg/attribute/letter-spacing/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/svg/attribute/letter-spacing/index.html')
-rw-r--r--files/zh-cn/web/svg/attribute/letter-spacing/index.html90
1 files changed, 90 insertions, 0 deletions
diff --git a/files/zh-cn/web/svg/attribute/letter-spacing/index.html b/files/zh-cn/web/svg/attribute/letter-spacing/index.html
new file mode 100644
index 0000000000..4f2568aeba
--- /dev/null
+++ b/files/zh-cn/web/svg/attribute/letter-spacing/index.html
@@ -0,0 +1,90 @@
+---
+title: letter-spacing
+slug: Web/SVG/Attribute/letter-spacing
+translation_of: Web/SVG/Attribute/letter-spacing
+---
+<div>{{SVGRef}}</div>
+
+<p><span class="seoSummary">The <strong><code>letter-spacing</code></strong> attribute controls spacing between text characters, in addition to any spacing from the {{SVGAttr("kerning")}} attribute.</span></p>
+
+<p>If the attribute value is a unitless number (like <code>128</code>), the browser processes it as a {{cssxref("length")}} in the current user coordinate system.</p>
+
+<p>If the attribute value has a unit identifier, such as <code>.25em</code> or <code>1%</code>, then the browser converts the &lt;length&gt; into its corresponding value in the current user coordinate system.</p>
+
+<p class="note"><strong>Note:</strong> As a presentation attribute, <code>letter-spacing</code> can be used as a CSS property. See the {{cssxref("letter-spacing", "CSS letter-spacing")}} property for more information.</p>
+
+<p>As a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: {{SVGElement("altGlyph")}}, {{SVGElement("text")}}, {{SVGElement("textPath")}}, {{SVGElement("tref")}}, and {{SVGElement("tspan")}}</p>
+
+<div id="topExample">
+<div class="hidden">
+<pre class="brush: css">html, body, svg {
+ height: 100%;
+}</pre>
+</div>
+
+<pre class="brush: html; hightlight[2,3]">&lt;svg viewBox="0 0 400 30" xmlns="http://www.w3.org/2000/svg"&gt;
+  &lt;text y="20" letter-spacing="2"&gt;Bigger letter-spacing&lt;/text&gt;
+  &lt;text x="200" y="20" letter-spacing="-0.5"&gt;Smaller letter-spacing&lt;/text&gt;
+&lt;/svg&gt;</pre>
+
+<p>{{EmbedLiveSample("topExample", "200", "30")}}</p>
+</div>
+
+<h2 id="Usage_notes">Usage notes</h2>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">Value</th>
+ <td><code>normal</code> | {{cssxref("length")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Default value</th>
+ <td><code>normal</code></td>
+ </tr>
+ <tr>
+ <th scope="row">Animatable</th>
+ <td>Yes</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>For a description of the values, please refer to the <a href="/en-US/docs/Web/CSS/letter-spacing#Values">CSS <code>letter-spacing</code></a> property.</p>
+
+<p class="note">As of May 2019, Firefox <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=371787">ignores <code>letter-spacing</code></a> and renders text without.</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("CSS3 Text", "#letter-spacing-property", "letter-spacing")}}</td>
+ <td>{{Spec2("CSS3 Text")}}</td>
+ <td>SVG 2 just refers to the definition in CSS Text 3.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName("SVG1.1", "text.html#LetterSpacingProperty", "letter-spacing")}}</td>
+ <td>{{Spec2("SVG1.1")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("svg.attributes.presentation.letter-spacing")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{cssxref("letter-spacing", "CSS letter-spacing")}}</li>
+</ul>