The text-decoration
property in CSS is used to style the decoration of text, such as underlining, overlining, line-through, and blink effects. It is a versatile property that can enhance the visual appearance of text.
Syntax
/* Example of using the text-decoration property */
.element {
text-decoration: [value];
}
The text-decoration
Property Values
The table below describes text-decoration values and their respective descriptions.
Text Decoration Value | Description |
---|---|
none | Default value. No text decoration is applied. |
underline | Adds an underline to the text. |
overline | Adds a line above the text. |
line-through | Adds a line through the middle of the text. |
blink | Causes the text to blink. (Note: Not widely supported and considered obsolete.) |
Features
- Multiple values can be combined to apply different decorations simultaneously.
-
The
text-decoration
property is often used in conjunction with the:hover
pseudo-class for interactive effects.