Home > Article > Web Front-end > The role of CSS text-decoration
The text-decoration property of CSS can add decorative effects to text, including underline, strikethrough, and overline. Usage: text-decoration: none, underline, overline, line-through.
The role of CSS text-decoration
The text-decoration
attribute of CSS is used to Add decorative effects to text, such as underline, strikethrough, and overline.
Function:
text-decoration
The attribute can specify the following four decorative effects:
Syntax:
text-decoration
The syntax of the attribute is as follows:
<code>text-decoration: none|underline|overline|line-through|initial|inherit;</code>
Usage:
To add decoration to the text of an element, you can use the text-decoration
attribute as follows:
<code class="css">p { text-decoration: underline; }</code>
The above code will be used for paragraph< The text in p>
is underlined.
Examples:
Here are some examples of creating text decoration effects using different text-decoration
values:
<p style="text-decoration: underline;">Underlined text</p>
Strikethrough text
Underlined text
No text decoration
The
text-decoration attribute is widely supported in all modern browsers.
The above is the detailed content of The role of CSS text-decoration. For more information, please follow other related articles on the PHP Chinese website!