-2

I'm trying to write a piece of code for my website, however can't seem to get rid of the underline on the link. I keep testing it on w3schools and it's not disappearing. The code is as below:

   <p><span style="color: #ff8000; font-size:80%; font-family:roboto">Please <a href="#"><span style="color: #525252; font-size:100%; font-family:roboto;">contact us</a> if you are interested in this product.</p>

I can't find an answer to my question anywhere, when I do text-decoration: line-through, it works, so why not text-decoration: none?

Eve
  • 11
  • 2

1 Answers1

0

The css property for removing the underline of anchor elements is:

text-decoration: none

Maybe you are applying the css style to the wrong element. Make sure you apply it to the <a> element

   <p><span style="color: #ff8000; font-size:80%; font-family:roboto">Please <a style="text-decoration: none;" href="#"><span style="color: #525252; font-size:100%; font-family:roboto;">contact us</a> if you are interested in this product.</p>
DigitalJedi
  • 1,577
  • 1
  • 10
  • 29
  • @isherwood I updated my answer, It appears that the user maybe is applying the style to the wrong element. As you can clearly see, `text-decoration: none` works just as it's supposed to – DigitalJedi Jun 11 '19 at 15:44