homepage Welcome to WebmasterWorld Guest from 54.243.12.156
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

    
Limit link underline to text
No line under the image
Rain_Lover




msg:4293717
 4:20 pm on Apr 7, 2011 (gmt 0)

I'd like to have the underline for the text only and at the same keep the image part of the link:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<title>Test</title>

<style type="text/css">
a:hover {text-decoration:none;}
img {border:none; vertical-align:bottom; padding-left:15px}
</style>

<a href="#">Subscribe to feed<img src="http://www.google.com/phone/static/images/feed-icon.gif" alt=""></a>


The code result isn't the same in all major browsers.
Many thanks for any help!

 

alt131




msg:4294581
 12:36 pm on Apr 9, 2011 (gmt 0)

Try adding margin-right:-31px to the css for the image.
(Where 31 = 15px padding + 16px image width)

Rain_Lover




msg:4294678
 5:05 pm on Apr 9, 2011 (gmt 0)

Simple and neat! Thanks!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved