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/baseline-shift | |
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/baseline-shift')
-rw-r--r-- | files/zh-cn/web/svg/attribute/baseline-shift/index.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/files/zh-cn/web/svg/attribute/baseline-shift/index.html b/files/zh-cn/web/svg/attribute/baseline-shift/index.html new file mode 100644 index 0000000000..b8f1c8f5f5 --- /dev/null +++ b/files/zh-cn/web/svg/attribute/baseline-shift/index.html @@ -0,0 +1,69 @@ +--- +title: baseline-shift +slug: Web/SVG/Attribute/baseline-shift +tags: + - SVG + - SVG属性 + - 需要兼容性表 +translation_of: Web/SVG/Attribute/baseline-shift +--- +<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG属性参考主页</a></p> + +<p>属性<code>baseline-shift</code>允许相对于父文本内容元素的<code>dominant-baseline</code>重定位<code>dominant-baseline</code>。该切换对象必须是一个下标或上标。</p> + +<p>作为一个外观属性,它还可以直接作为CSS样式表内部的属性使用。请看{{ cssxref("baseline-shift","CSS baseline-shift") }}以了解更多信息。</p> + +<h2 id="用法">用法</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="row">类别</th> + <td>外观属性</td> + </tr> + <tr> + <th scope="row">值</th> + <td><strong>auto</strong> | baseline | super | sub | <percentage> | <a href="/en/SVG/Content_type#Length" title="https://developer.mozilla.org/en/SVG/Content_type#Length"><length></a> | 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/SVG11/text.html#BaselineShiftProperty" title="http://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty">SVG 1.1 (2nd Edition)</a></td> + </tr> + </tbody> +</table> + +<dl> + <dt>baseline</dt> + <dd>没有基线切换,<code>dominant-baseline</code>依然在原来的位置。</dd> + <dt>sub</dt> + <dd><code>dominant-baseline</code>切换到下标的默认位置。</dd> + <dt>super</dt> + <dd><code>dominant-baseline</code>切换到上标的默认位置</dd> + <dt><percentage></dt> + <dd>该属性的结果值是这个百分数乘以 {{ SVGElement("text") }}元素的{{ SVGAttr("line-height") }}。如果是正值,dominant-baseline向shift同方向移动结果值;如果是负值,dominant-baseline向shift反方向移动结果值,相对于父文本内容元素。值“0%”等于”baseline“。</dd> + <dt><a href="/en/SVG/Content_type#Length" title="https://developer.mozilla.org/en/SVG/Content_type#Length"><length></a></dt> + <dd>如果是正值,dominant-baseline向shift同方向移动<a href="/en/SVG/Content_type#Length" title="https://developer.mozilla.org/en/SVG/Content_type#Length"><length></a>距离;如果是负值,dominant-baseline向shift反方向移动<a href="/en/SVG/Content_type#Length" title="https://developer.mozilla.org/en/SVG/Content_type#Length"><length></a>距离。值”0cm“等于”baseline“。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<h2 id="元素">元素</h2> + +<p><code><font face="Open Sans, Arial, sans-serif">下列这些元素可以使用</font>baseline-shift</code>属性。</p> + +<ul> + <li>{{ SVGElement("tspan") }}</li> + <li>{{ SVGElement("tref") }}</li> + <li>{{ SVGElement("altGlyph") }}</li> + <li>{{ SVGElement("textPath") }}</li> +</ul> + +<h2 id="参见">参见</h2> + +<ul> + <li>{{ cssxref("baseline-shift","CSS baseline-shift") }}</li> +</ul> |