CSS text-decoration 属性


实例

设置h1,h2,h3和h4元素文本装饰:

h1 {text-decoration:overline}
h2 {text-decoration:line-through}
h3 {text-decoration:underline}

尝试一下 »

属性定义及使用说明

text-decoration 属性规定添加到文本的修饰。

注意: 修饰的颜色由 "color" 属性设置。

默认值: none
继承: no
版本: CSS1
JavaScript 语法: object.style.textDecoration="overline"


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流浏览器都支持text-decoration属性。

注意: IE7和更早的版本不支持"inherit"的值。IE8需要定义!DOCTYPE。IE9支持"inherit"。


属性值

描述
none 默认。定义标准的文本。
underline 定义文本下的一条线。
overline 定义文本上的一条线。
line-through 定义穿过文本下的一条线。
blink 定义闪烁的文本。
inherit 规定应该从父元素继承 text-decoration 属性的值。


相关文章

CSS 教程: CSS 文本