Forum Moderators: not2easy

Message Too Old, No Replies

removing borders from image links?

need to remove a border around image links...

         

dave815

7:56 pm on Feb 13, 2004 (gmt 0)



Hello everyone!

I currently have several image links that appear to be working fine, but when I view them on a mac, a border appears around any of them when I either click on them or return back and they are a visited link. I am new to the use of CSS, but I think there is a way to make this work. So far my numerous efforts have been in vain.

Any suggestions or directing to a handy tutorial on this subject would be hugely appreciated.

Thanks!

Dave

DanA

8:50 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



You can use
img{
border:0px;
}
in your stylesheet if you want no border at all for all your images.

bruhaha

9:17 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



If it so happens that you want a border on your images, except for the linked ones, you could set a general style (with borders) for your images, then add an exception for images appearing inside links thus:


img {
border:2px solid green;
}
a img {
border:0px;
}

Incidentally, it's a good idea to list them in this order, since styles listed later generally supercede earlier ones. That should not happen in this particular case, because "a img" is more specific than "img", and more specific selectors take precedence. But it is still a wise practice!