Click to See Complete Forum and Search --> : Multiple image border styles


sully96
03-14-2005, 07:47 PM
Brand new to css. I'm setting up a page with images that link to larger versions. The page is linked to an external css sheet, mainly for text on the page.

I included thisline:

a:link img {border-color: #000000; border-width: 2px;}
a:visited img {border-color: #000000; border-width: 2px;}

to always keep a 2 px black border around the images. Problem is, any other liked images (buttons) with no borders, end up showing the same 2 px black border.

Go easy on me I'm new, any help is appreciated.

Thanks

Jona
03-14-2005, 11:11 PM
For the images whom you do not want to have a border, give them a class name.


<style type="text/css"><!--
a:link img, a:visited img {
border: solid 2px #000;
}

img.noBorder {
border: none;
}
--></style>



<a href="page.html" title="Go to a page."><img src="gotopage.gif" alt="Go to a page." class="noBorder"></a>

.
.
.

<img src="mykittens.jpg" alt="My kittens.">

sully96
03-15-2005, 07:38 AM
Thanks I'll give it it try.