Home > Web Front-end > CSS Tutorial > How Can I Remove Underlines from Anchor Links Using CSS?

How Can I Remove Underlines from Anchor Links Using CSS?

Patricia Arquette
Release: 2024-12-12 17:51:20
Original
477 people have browsed it

How Can I Remove Underlines from Anchor Links Using CSS?

Remove Underlines from Anchor Elements with CSS

Want to give your hyperlinked text a more polished look without the default underline? CSS offers a simple solution to this common styling concern.

Solution:

CSS provides a property called text-decoration that allows you to control the appearance of text embellishments like underlines. By setting this property to none, you can eliminate underlining from both anchors () and underlined text ().

a, u {
  text-decoration: none;
}
Copy after login

For further customization, you can target only anchor elements with more specific selectors:

a {
  text-decoration: none;
}
Copy after login

Important Note:

If other styles you've applied override the text-decoration property, you can ensure the desired effect by using the !important modifier:

a {
  text-decoration: none !important;
}
Copy after login

The above is the detailed content of How Can I Remove Underlines from Anchor Links Using CSS?. For more information, please follow other related articles on the PHP Chinese website!

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