Text Decoration
It specifies the decoration added to the text. We can set this property to none, underline, overline, line-through.
- text-decoration-line
- text-decoration-style
- text-decoration-color
- text-decoration
text-decoration-line
This property is used to specify what type of line the decoration will have. We can set this property to none, underline, overline, line-through We can combine more than one value, like underline and overline to display lines both under and over the text.
Example:
h1 {
text-decoration-line: underline;
}
text-decoration-style
This property is used to specify how the line will display. We can set this property to solid, double, dotted, dashed, wavy.
Example:
h1 {
text-decoration-line: underline;
text-decoration-style: dotted;
}
text-decoration-color
This property is used to specify the color of the text-decoration-line.
Example:
h1 {
text-decoration-line: underline;
text-decoration-color: red;
}
text-decoration
This is shorthand of all three text-decoration properties.
Syntax:
Selector {
text-decoration: text-decoration-line text-decoration-style text-decoration-color
}
Example:
h1 {
text-decoration: underline dotted red ;
}
Text Overflow
text-overflow
The text-overflow property specifies how overflowed content that is not displayed should be signaled to the user.
- clip - Clips the text
- ellipsis - Render an ellipsis("...") to represent clipped text
- string - Render the given string to represent clipped text
Example:
p{
text-overflow : ellipsis;
}