Forums

CSS - remove linked image underline (5 posts)

  1. dponce80
    Member
    Posted 5 years ago #

    I feel that this should be so simple. Yet I know so little! :) In the stylesheet, I have it so that all my links are underlined with a 1px dash. On mouse hover, it becomes a full line. Really pretty, except when it also underlines images! I want to put images (such as a blog directory subscription icon) and not have it become underlined as well. Is there a way to manually specify an exception to the stylesheet? Or something... Can this be done?

    Thanks guys.

  2. Yngwin
    Member
    Posted 5 years ago #

    Probably the most straight-forward way is to give links that contain images a class, like:
    <a href="xxx" class="image"><img src="x" alt="" /></a>
    and put in your stylesheet:
    .image {
    text-decoration: none;
    border-bottom: none;
    }

  3. dponce80
    Member
    Posted 5 years ago #

    Wow... that worked almost perfectly, with one little addition that I was able to figure out myself. Since the mouse hover was also underlined (instead of dashed), i had to add another little piece of code to the stylesheet, namely
    .image:hover {
    text-decoration: none;
    border-bottom: none;
    }

    Thanks a lot, now it works like a charm!

  4. Yngwin
    Member
    Posted 5 years ago #

    You can group these together like
    .image, .image:hover {

  5. Ronny
    Member
    Posted 5 years ago #

    argh. can't get it to work for my blog sticker/button images things. followed the instructions to the letter and double checked my code. but there's still an underline.

    forget about the "reading list" book cover images. those images are part of another plugin... but the blog stickers are using good old fashion html

    <li id="groupies"><?php _e('Groupies:'); ?>
    <ul>
    <li><a href="http://shittyblogsclub.blogcafe.com/shittyblogsclub" class="image" target="_blank" ><img src ="http://www.fish8me.com/images/shittyblogclub.gif
    " border="0" Title="Shitty Blogs Club" alt="" ></a></li>
    </ul>
    </li>

    any ideas?
    http://www.fish8me.com

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.