目录

CSS text-underline-position 属性


示例

设置下划线文本装饰的位置:

div.a {
  text-decoration: underline;
  text-underline-position: auto;
}

div.b {
  text-decoration: underline;
  text-underline-position: under;
}
亲自试一试 »

定义和用法

这个text-underline-position属性指定下划线文本装饰的位置。

展示演示❯

默认值: 汽车
遗传: 是的
可动画: 不。阅读可动画的
版本: CSS3
JavaScript 语法: 对象.style.textUnderlinePosition="under"尝试一下

浏览器支持

表中的数字指定完全支持该属性的第一个浏览器版本。

Property
text-underline-position 33.0 79.0 74.0 12.1 20.0


CSS 语法

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 属性