Home  >  Article  >  Web Front-end  >  How to remove underline in css

How to remove underline in css

下次还敢
下次还敢Original
2024-04-25 12:27:14665browse

Text underline can be canceled through the text-decoration property in CSS: Set text-decoration to none to cancel all text decoration effects. Apply this style to specific elements that need to be underlined.

How to remove underline in css

CSS Cancel Underline

How to cancel text underline in CSS?

In CSS, you can use the following attribute to cancel text underlining:

<code class="css">text-decoration: none;</code>

Description:

  • text- The decoration attribute is used to set the decoration effect of text, including underline, strikethrough and overline. The
  • none value removes all text decorations, including underlining.

Example:

To ununderline text within a paragraph element, use the following code:

<code class="css">p {
  text-decoration: none;
}</code>

Note:

  • Make sure to apply this style to the specific element you want to ununderline.
  • If the text's parent element has the text-decoration style applied, you may need to override it using the !important rule:
<code class="css">p {
  text-decoration: none !important;
}</code>

The above is the detailed content of How to remove underline in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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