设置不同 <div> 元素的文本方向:
div.a {
text-orientation: mixed;
}
div.b {
text-orientation: upright;
}
亲自试一试 »
这个text-orientation
属性指定字符的方向。
笔记:仅在以下情况下有效写作模式设置为垂直。
表中的数字指定完全支持该属性的第一个浏览器版本。
Property | |||||
---|---|---|---|---|---|
text-orientation | 48.0 | 79.0 | 41.0 | 14.0 | 35.0 |
sideways (property value) |
Not supported | Not supported | 44.0 | Not supported | Not supported |
text-orientation: mixed|upright|sideways|sideways-right|use-glyph-orientation|initial|inherit;
Value | Description | Demo |
---|---|---|
mixed | Deafult value. Characters are rotated 90 degrees clockwise. | Demo ❯ |
upright | Characters are not rotated, but standing upright. | Demo ❯ |
sideways | Only supported in Firefox. Characters are orientated the same as the text lines are oriented with writing-mode vertical, 90 degrees clockwise. | |
sideways-right | Equal to property value sideways. Kept for compatibility purposes. | |
use-glyph-orientation | For use in SVG elements, so that text inherits deprecated SVG properties glyph-orientation-vertical and glyph-orientation-horizontal. | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
text-orientation 属性可用于更改表标题中的方向:
th {
writing-mode: vertical-lr;
text-orientation: upright;
}
亲自试一试 »
CSS 写入模式属性:CSS 写入模式属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!