Home > Article > Web Front-end > What does underline mean in css
Underline in CSS is a text decoration attribute used to add a horizontal line below the text. It is set through the text-decoration attribute. The optional values are none (no underline), underline (underline) and line -through (strikethrough); in addition, the text-decoration attribute also supports overline (overline), blink (blink, not recommended) and wavy (wavy line, not supported in all browsers).
Underline in CSS
In CSS, underline means adding a horizontal line to text. It is a text decoration attribute that can be applied to text within HTML elements.
How to use dashes
In CSS, use the text-decoration
property to set dashes. The value of this attribute can be one of the following three values:
none
: Do not add any dashes. underline
: Add a horizontal underline. line-through
: Adds a horizontal line through the text. For example, to add a horizontal stroke to text in an HTML element, you can use the following CSS code:
<code class="css">element { text-decoration: underline; }</code>
Other stroke attributes
In addition to the above three values, the text-decoration
attribute also supports the following additional attributes:
overline
: Add a horizontal line above the text . blink
: Make text blink (deprecated). wavy
: Makes text appear wavy (not supported in all browsers). Example
The following is a code example using different underline attributes:
<code class="css">p { text-decoration: underline; } h1 { text-decoration: line-through; } span { text-decoration: overline; }</code>
In the above example, the paragraph (p
) text will be underlined, Heading 1 (h1
) text will be strikethrough, span (span
) text will be overlined.
The above is the detailed content of What does underline mean in css. For more information, please follow other related articles on the PHP Chinese website!