Welcome to WebmasterWorld Guest from 54.166.214.107

Forum Moderators: not2easy

Message Too Old, No Replies

Eliminate border on hyperlinked image?

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

New User

10+ Year Member

joined:Sept 14, 2005
posts:9
votes: 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 Sept 14, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 28, 2005
posts:646
votes: 0


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

a img { border: 0; }

:D

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

New User

10+ Year Member

joined:Sept 14, 2005
posts:9
votes: 0


I'll give this a try, thanks. :)
10:30 am on Sept 14, 2005 (gmt 0)

New User

10+ Year Member

joined:Sept 14, 2005
posts:9
votes: 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 Sept 14, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Feb 14, 2005
posts:266
votes: 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 Sept 14, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:June 20, 2002
posts:439
votes: 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 Sept 14, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Oct 15, 2003
posts:276
votes: 0


Try using the following code: a img { border: none; }
11:15 am on Sept 14, 2005 (gmt 0)

New User

10+ Year Member

joined:Sept 14, 2005
posts:9
votes: 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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members