DEV Community 👩‍💻👨‍💻

Carnato
Carnato

Posted on

How to remove the <a></a> tag color and underline

a{
all:unset;
text-decoration:none;
}
Enter fullscreen mode Exit fullscreen mode
  1. all:unset this property is used in anchor tag to remove the color from the anchor tag sentence.
  2. text-decoration:none; this property is used to remove the underline from the sentence.

Top comments (2)

Collapse
 
lukeshiru profile image
Luke Shiru

2 things:

  1. You shouldn't do this unless you'll provide another visual feedback to make that anchor be recognizable for users (like showing the underline on hover or something like that).
  2. If you'll do this, ideally the reset should inherit instead of unset:
a {
    color: inherit;
    text-decoration: inherit;
}

a:hover {
    text-decoration: underline;
}
Enter fullscreen mode Exit fullscreen mode

Cheers!

Collapse
 
carnato profile image
Carnato Author

Okay sir 😊 for correction

🌚 Life is too short to browse without dark mode