textdecorationline

收藏:0   阅读:39

Style textDecorationLine 属性

实例

在段落的顶部显示一条线:

document.getElementById("myP").style.textDecorationLine="overline";


定义和用法

textDecorationLine 属性设置或返回文本修饰要使用的线条类型。

注意:您也可以使用 textDecoration 属性设置 textDecorationLine。textDecoration 属性是 textDecorationLine、textDecorationStyle 和 textDecorationColor 属性的速记属性。

注意:您也可以同时使用多个值,比如 underline overline,来在文本的上方和下方都显示线条。


浏览器支持

Internet Explorer Firefox Opera Google Chrome Safari

几乎所有的主流浏览器都不支持 textDecorationLine 属性。

Firefox 支持另一个可替代该属性的属性,即 MozTextDecorationLine 属性。


语法

返回 textDecorationLine 属性:

object.style.textDecorationLine

设置 textDecorationLine 属性:

object.style.textDecorationLine="none|underline|overline|line-through|initial|inherit"

属性值

描述
none 默认值。规定文本修饰没有线条。
underline 规定文本的下方将显示一条线。
overline 规定文本的上方将显示一条线。
line-through 规定文本的中间将显示一条线。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

技术细节

默认值: none
返回值: 字符串,表示元素的 text-decoration-line 属性。
CSS 版本 CSS3


相关文章

CSS 参考手册:text-decoration-line 属性

© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!