Title: CSS &#8211; remove linked image underline
Last modified: August 18, 2016

---

# CSS – remove linked image underline

 *  [dponce80](https://wordpress.org/support/users/dponce80/)
 * (@dponce80)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/css-remove-linked-image-underline/)
 * 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.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [yngwin](https://wordpress.org/support/users/yngwin/)
 * (@yngwin)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/css-remove-linked-image-underline/#post-132821)
 * 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; }
 *  Thread Starter [dponce80](https://wordpress.org/support/users/dponce80/)
 * (@dponce80)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/css-remove-linked-image-underline/#post-132832)
 * 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!
 *  [yngwin](https://wordpress.org/support/users/yngwin/)
 * (@yngwin)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/css-remove-linked-image-underline/#post-132833)
 * You can group these together like
    `.image, .image:hover {`
 *  [Ronny](https://wordpress.org/support/users/ronny/)
 * (@ronny)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/css-remove-linked-image-underline/#post-133321)
 * 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](http://www.fish8me.com)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘CSS – remove linked image underline’ is closed to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [Ronny](https://wordpress.org/support/users/ronny/)
 * Last activity: [21 years, 4 months ago](https://wordpress.org/support/topic/css-remove-linked-image-underline/#post-133321)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
