Grow your CSS skills. Land your dream job.

How to Remove Underline

  • # January 20, 2013 at 8:43 pm

    I have an issue. Here is the CodePen. I have an “h1″ as the title of my page. I added an underline to “a” and I had to systematically remove it from everything I did not want a underline on. But I can’t seem to figure out how to get rid of it for the “h1.” I used text-decoration: none, but it seems to do nothing. Also, the underline is repeating itself four times over because I have a text-shadow on my “h1″ as well. How do I get rid of it? Thank you in advance!

    # January 20, 2013 at 8:48 pm

    The problem is that you did not give the underline to the h1 element but instead to the parent a element. So to remove that underline you would have to give the a tag text-decoration:none; not the h1. [Like this](http://codepen.io/uneart/pen/bDtnC)

    # January 20, 2013 at 9:00 pm

    But that removes the underline from all links. I want my links to have an underline if they are anything but the header area. How do I accomplish this?

    # January 20, 2013 at 9:24 pm

    add this:

    `#logo{
    text-decoration: none;
    }`

    # January 20, 2013 at 9:31 pm

    Thank you muchly, @defogge.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".