-2

I was wondering how you would disable to underline on the "a" attribute, for href's. I find it annoying, and I was wondering if there was a bit of code I could add to my .css to change it. Thank you.

2 Answers2

1

simply set a {text-decoration:none}

see in action:

a {
  text-decoration: none
}
<a href="#">No Underline</a>

EDIT (I am editing this to whoever downvote it, because that could be the only reason for)

In case you have multiple a's and some of them don't have the attribute href then you can target the href like this:

/*demo */

div {
  border: dotted lightblue;
  margin: 10px;
  font-size:30px
}
a {
  display: block;
}
/*in action*/
div:last-of-type a[href] {
  text-decoration: none
}
<div>
  <a>Without href doesn't make it a link</a>
  <a href="#">Link with Underline</a>
</div>
<div>
  <a>Without href doesn't make it a link</a>
  <a href="#">Link Without Underline</a>
</div>
dippas
  • 58,591
  • 15
  • 114
  • 126
0

A simple google search provides this very easy....

a {
    text-decoration: none;
}
NooBskie
  • 3,761
  • 31
  • 51