Home > Web Front-end > CSS Tutorial > What does underline mean in css

What does underline mean in css

下次还敢
Release: 2024-04-26 10:51:14
Original
1010 people have browsed it

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).

What does underline mean in css

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>
Copy after login

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>
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template