The CSS property used for text decoration is the text-decoration
property. It is used to control the visual styling of text decorations, such as underlines, overlines, and line-throughs.For instance, setting text-decoration: none;
on links removes the default underline
Syntax:
The text-decoration
the property accepts various values to define different text decorations.
/* Removing underline from links */
a {
text-decoration: none;
}
/* Adding underline to headings */
h1 {
text-decoration: underline;
}
Features
The Features of text-decoration
Property:
- Specifies the decoration applied to the text.
-
Values include
none
,underline
,overline
,line-through
, and their combinations. - Can be applied to specific elements or global selectors.