Setting a single text style in CSS can be achieved through the text-decoration attribute. You can add underline, strikethrough, overline or wavy line to the text. The syntax is: text-decoration: none | underline | overline | line -through | wavy;.
Set a single text style in CSS
In CSS, you can use text-decoration
attribute to set the style of a single text. This property allows you to underline, strikethrough, overline, or tilde text.
Syntax:
<code class="css">text-decoration: none | underline | overline | line-through | wavy;</code>
Values:
Usage example:
To add underline to a specific text element, you can use the following code:
<code class="css">.my-text { text-decoration: underline; }</code>
To remove the underline of the text element To delete the line, you can use the following code:
<code class="css">.my-text { text-decoration: none; }</code>
Other CSS properties:
In addition to the text-decoration
property, CSS also provides some other Properties to control the text style, for example:
The above is the detailed content of How to set a single text style in css. For more information, please follow other related articles on the PHP Chinese website!