Property Description
The text-decoration property sets the decoration added to text.
This property has the following syntax:
text-decoration: none|underline|overline|line-through|initial|inherit;
Property Values
Value | Description |
---|---|
none | (default) No decoration is added to the text |
underline | Draws a line below the text |
overline | Draws a line above the text |
line-through | Draws a line through the text |
initial | Specifies that the value of the property should be set to the default value |
inherit | Specifies that the value of the property should be inherited from the parent element |
Examples
This example sets the text decoration for h1, h2, and h3 elements.
h1 {
text-decoration: underline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: overline;
}
This example shows the results of setting the various text-decoration values:
text-decoration: none
text-decoration: underline
text-decoration: overline
text-decoration: line-through
text-decoration: underline
text-decoration: overline
text-decoration: line-through
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
1.0 | 1.0 | 3.0 | 1.0 | 3.5 |
Miscellaneous Information
Inherited: | No |
---|---|
Defined In: | CSS1, renewed in CSS3 |
Default Value: | none |