PDA

View Full Version : problem getting borders around images


charly
01-15-2009, 04:31 AM
i am using ap divs to place a series of images on my site. in my css stylesheet is this rule: }
.img {
border: thin solid #000000;
}

My problem is that only about half my images on each page actually get a border - some do, some don't. Additionally, some even get a border on one or two sides only, or even half a border on one side.

When I click on the yellow box (after the image has been inserted), sometimes the box has an additional horizontal line either at the bottom or in the middle. And, I've noted that when I highlight (click on) one box, several of them become highlighted.

Somehow, I wonder if this isn't all related and is why my borders are showing up irratically.

May it have something to do with the size of the image in relation to the size of the container box? Although, both are assigned height:640 and width:424 (or vs. if it's a horizontal image).

Thanks for any help anyone can come up with. I'm way new to all this.
Charly

domedia
01-15-2009, 06:23 AM
The border goes outside the image, so if the image and the parent element is the same size, it's theoretically not going to show the border of the img.
There's usually no reason to contain an image in a separate DIV though, so you could possibly just remove it.

coloeagle
01-15-2009, 02:34 PM
i am using ap divs to place a series of images on my site. in my css stylesheet is this rule: }
.img {
border: thin solid #000000;
}
You have the above set as a class. This will only affect the elements that are calling for this class. If you want all the images to have this border remove the dot (class designation).
img {
border: thin solid #000000;
}