CSS text-decoration-line property

CSS Reference CSS Reference


Examples

At the top of the paragraph a line appears:

p
{
text-decoration-line: overline;
-moz-text-decoration-line: overline; /* 针对 Firefox 的代码 */
}


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Almost all of the major browsers do not support text-decoration-line property.

Firefox supports another alternative of the property attribute that -moz-text-decoration-line property.


Definition and Usage

text-decoration-line text attribute specifies the modified line type to use.

Note: You can also use the text-decoration property set text-decoration-line. text-decoration property is text-decoration-line, text-decoration-style and text-decoration-color attribute shorthand property.

Note: You can also use multiple values simultaneously, such as underline and overline, to show the lines above and below the text.

Defaults: none
inherit: no
Can be animated: no. Please refer to animation (Animatable) .
version: CSS3
JavaScript syntax: object .style.textDecorationLine = "overline"to try


CSS Syntax

text-decoration-line: none|underline|overline|line-through|initial|inherit;

Property Value

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

CSS Reference CSS Reference