text-decoration
The text-decoration property adds underlines, overlines, or line-throughs to text. It's commonly used for links and emphasis. Modern CSS allows controlling line style, color, and thickness.
Text Decoration Values
Value | Effect | Example |
|---|---|---|
none | No decoration | No line |
underline | Line below text | Underlined text |
overline | Line above text | Overlined text |
line-through | Line through text | Crossed text |
CSS
/* Text decoration */
a {
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
/* Remove default underline */
a {
text-decoration: none;
}
/* Strikethrough */
.deleted {
text-decoration: line-through;
}
/* Multiple decorations */
.special {
text-decoration: underline overline;
}Note
Text-decoration adds lines to text. Common on links. Remove default underline and style to your design.
Next
Text transform: [text-transform](/css/text-transform).