CSS text-decoration
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The text-decoration
CSS property specifies the decorations to be applied on the text content of an element such as underline, overline, etc.
The following table summarizes the usages context and the version history of this property.
Default value: | none |
---|---|
Applies to: | All elements |
Inherited: | No |
Animatable: | Yes, as some of the properties of the shorthand are animatable. See animatable properties. |
Version: | CSS 1, 2, 3 |
Syntax
The syntax of the property is given with:
The example below shows the text-decoration
property in action.
Example
Try this code »a {
text-decoration: none;
}
h1 {
text-decoration: overline;
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
none |
Produces no text decoration. |
underline |
Each line of text is underlined. |
overline |
Each line of text has a line above it. |
line-through |
Each line of text has a line through the middle. |
blink |
Makes the text blink (alternates between visible and invisible). |
inherit |
If specified, the associated element takes the computed value of its parent element text-decoration property. |
Browser Compatibility
The text-decoration
property is supported in all major modern browsers.
Basic Support—
|
Warning: The blink
value of this property is only supported by Firefox and Opera. This value is deprecated in favor of animations, you should better avoid this value.
Further Reading
See tutorial on: CSS Text, CSS Border, CSS3 Animations.
Text-related properties: letter-spacing
, text-align
, text-indent
, text-overflow
, text-shadow
, text-transform
, white-space
, word-spacing
.