Guest estelle Posted December 9, 2005 Share Posted December 9, 2005 Does anyone know how to *not* underline images that are links? Example a { text-decoration: underline; } a:hover { text-decoration: none; } <a href="..."><img src="..."><br/>text</a> EDIT: Example shown here: http://www.beadberry.com/index.php?act=viewCat&catId=50 The image is underlined (except when the mouse hovers over it). Really what i want is *only* the text to be underlined. And i want this style to be standard - i don't want to have to apply a class to every single link or every single image. I have tried everything i can think of to stop this from happening. E.g. img { text-decoration: none; } img:hover { text-decoration: none; } a img { text-decoration: none; } I know there's a way to do this, but none of the above work and i just don't know my CSS well enough to figure this out ;) Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 9, 2005 Share Posted December 9, 2005 img:hover doesn't really mean anything, a img:hover or a:hover img (I use the second case) I've never had this problem. By default, text should get underlined, therefore "text-decoration: none;" By default, images get blue borders, therefore a:hover img { border: none; } Where can I see this in practice? ;) Quote Link to comment Share on other sites More sharing options...
Guest estelle Posted December 9, 2005 Share Posted December 9, 2005 Okay, i just made a quick test html file and it worked fine, so i must have over simplified the problem. It must be something to do with the fact that two classes are involved, txtDefault and imgDefault. Example shown here: http://www.beadberry.com/index.php?act=viewCat&catId=50 Mark, if you know off the top of you head what the solution is, then let me know. But i don't want anyone wasting any significant time over this, because its only a tiny annoyance. Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 9, 2005 Share Posted December 9, 2005 Just looked at your link; in IE, it is the text beneath the images that is underlined, not the images themselves . . . gonna look now in Mozilla . . . Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 9, 2005 Share Posted December 9, 2005 OK I can see it in Mozilla but in IE it's fine. Second time today I've seen screwy behaviour from the other guys for a change You're probably on to something with the conflicting classes . . . right now I don't have a clue :D Quote Link to comment Share on other sites More sharing options...
Guest estelle Posted December 9, 2005 Share Posted December 9, 2005 Don't worry. Thanks for looking at it Mark I know that if i take out the classes then it works, so i'll look into this again later. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.