WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove underline from linked images (8 posts)

  1. NateAnglin@gmail.com
    Member
    Posted 1 year ago #

    Good afternoon,

    I've decided to underline all my hyperlinks, however whenever I try to make an image linked it underlines the image. Whats the workaround for this? You can see an example on my site via the below url. The buy now button is underlined at the bottom of the page.

    http://www.nateanglin.com/striiv-play-pedometer-unboxed-and-how-to-set-it-up/

  2. rezag
    Member
    Posted 1 year ago #

    For that image link add

    style="text-decoration: none;"

  3. NateAnglin@gmail.com
    Member
    Posted 1 year ago #

    Thank you!

    I would want this for every image so would I just put this in the style.css or even custom css?

  4. rezag
    Member
    Posted 1 year ago #

    Try

    a img {text-decoration: none;}

  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    The "underline" is a bottom border on links - this:

    .single-content a {
        border-bottom: 1px dashed;
        color: #BA0D16;
    }

    Text-decoration styles won't change that.

  6. NateAnglin@gmail.com
    Member
    Posted 1 year ago #

    Okay, thank you all for your help. I think I'll just remove the underline from all links. Thats the only way right?

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Well, there's no doubt some way to do that, it's just a bit tricky with CSS sometimes. Actually using text-decoration looks like it would work - at least testing in Firebug it does:

    .single-content a {
        color: #BA0D16;
        text-decoration: underline;
    }

    It doesn't look quite like the border, and there probably IS a way to do that, but see if the above works and looks okay to you.

  8. NateAnglin@gmail.com
    Member
    Posted 1 year ago #

    That worked, thank you!!!

    I'll just have it underline when they hover.

Topic Closed

This topic has been closed to new replies.

About this Topic