homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Eliminate border on hyperlinked image?

 12:27 am on Sep 14, 2005 (gmt 0)

Over the past week, I've been trying to learn CSS and have come up with the majority of coding issues I had, with two exceptions . . . tables (not too urgent at this moment) and borders around hyperlinked images (HOT).

I've searched for coding on eliminating the border around a hyperlinked image. This is extremely important as on my well over 500 pages I have on line, the majority are image hyperlinks necessary for style and theme. Can someone help?



 1:45 am on Sep 14, 2005 (gmt 0)

If absolutely all images with hyperlinks need no border, simply:

a img { border: 0; }



 10:20 am on Sep 14, 2005 (gmt 0)

I'll give this a try, thanks. :)


 10:30 am on Sep 14, 2005 (gmt 0)

I tried as you suggested. Unfortunately, it didn't work. I could go back to the border=0 acceptable in Traditional, but I was hoping to keep code validated as Strict.

If anyone else knows how I might do this, please let me know.


 10:43 am on Sep 14, 2005 (gmt 0)

And you don't have a more specific rule overriding Setek's (correct) suggestion? Try something like:

html body a img { border: 0; }

just to see. Do you get the same result if you use border-width: 0; instead of border: 0;?


 10:43 am on Sep 14, 2005 (gmt 0)

Make sure the image in question hasn't got border=1 or something similar after the image location and url.


 10:57 am on Sep 14, 2005 (gmt 0)

Try using the following code: a img { border: none; }


 11:15 am on Sep 14, 2005 (gmt 0)

Thanks for all your replies. I actually used part of Setek's code. I dropped the "a" and used the following:

img { border: 0; }

and it worked.

Thanks again, everyone.

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved