MDN wants to learn about developers like you:

我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

« SVG Attribute reference home

The writing-mode attribute specifies whether the initial inline-progression-direction for a <text> element shall be left-to-right, right-to-left, or top-to-bottom. The writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altGlyph> and <textPath> sub-elements. (Note that the inline-progression-direction can change within a <text> element due to the Unicode bidirectional algorithm and properties direction and unicode-bidi.

As a presentation attribute, it also can be used as a property directly inside a CSS stylesheet, see css writing-mode for further information

Usage context

Categories Presentation attribute
Value lr-tb | rl-tb | tb-rl | lr | rl | tb | inherit
Animatable Yes
Normative document SVG 1.1 (2nd Edition)
lr-tb | lr
Sets the initial inline-progression-direction to left-to-right, as is common in most Latin-based documents. For most characters, the current text position is advanced from left to right after each glyph is rendered.
rl-tb | rl
Sets the initial inline-progression-direction to right-to-left, as is common in Arabic or Hebrew scripts.
tb-rl | tb
Sets the initial inline-progression-direction to top-to-bottom, as is common in some Asian scripts, such as Chinese and Japanese. Though hardly as frequent as horizontal, this type of vertical layout also occurs in Latin based documents, particularly in table column or row labels. In most cases, the vertical baselines running through the middle of each glyph are aligned.



The following elements can use the writing-mode attribute

See also


 此頁面的貢獻者: teoli, Jeremie
 最近更新: teoli,