设置下划线文本装饰的位置:
div.a {
text-decoration: underline;
text-underline-position: auto;
}
div.b {
text-decoration: underline;
text-underline-position: under;
}
亲自试一试 »
这个text-underline-position
属性指定下划线文本装饰的位置。
表中的数字指定完全支持该属性的第一个浏览器版本。
Property | |||||
---|---|---|---|---|---|
text-underline-position | 33.0 | 79.0 | 74.0 | 12.1 | 20.0 |
text-underline-position: auto|under|from-font|left|right|initial|inherit;
Value | Description | Play it |
---|---|---|
auto | Default value. The browser sets the position of the underline | Demo ❯ |
under | Sets the underline below the alphabetic baseline | Demo ❯ |
from-font | If the font file includes information about underline position, use that value. If not, use auto | |
left | In vertical writing mode the underline will be placed to the left of the text. In horizontal writing mode the underline will be placed as auto | |
right | In vertical writing mode the underline will be placed to the right of the text. In horizontal writing mode the underline will be placed as auto | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS教程:CSS 文本装饰
HTML DOM 参考:textDecoration 属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!