Design + Coding > image border

I looked at the css for this page

KickstartMyDay

and Im trying to add a border to the thumbnail images. I used:

.img {border:1px solid #123379;}

but its not working

I also tried

.body .img {border:1px solid #123379;}

and

.p .body .img {border:1px solid #123379;}

what Im I doing wrong?

05.3.2008 | Registered Commenterenrique550

Remove the period on the image element (so just "img" not ".img"). Also you'd want it to be as specific as possible otherwise every image on your entire site (header, sidebar, etc) would have the border around them. Thus try something like the following.

.journal-entry .body img { border: 1px solid #123379; }

BTW here's something else you could try.

.journal-entry .body img { padding: 5px; background-color: #EFEFEF; border: 1px solid #123379; }

What that allows you to do is apply what looks like two borders to the single image. The inner border is actually created from the background color and padding of the image which in turn pushes the CSS border to the outside (and thus making it look like a secondary border).

Oh if you're someone who uses the WYSIWYG editor and inserts images that way, you can take advantage of the outer span tag placed around images to be very specific. So you could use the following instead.

.full-image-float-none img { padding: 5px; background-color: #EFEFEF; border: 1px solid #123379; }

That's just for the "float-none" one. You could also apply it to the "float-left" and "float-right" CSS elements as well if you wanted (as you'd probably want to make those ones have a smaller border since they are usually smaller images floating to the right or left).

05.3.2008 | Registered CommenterNollind Whachell

omg Nollind your help is much appreciated! It may be something simple but thanks for taking the time to expand :) I did your last suggestion. check it out, its hot!

05.3.2008 | Registered Commenterenrique550

Good stuff! Glad it worked out for you. :)

05.4.2008 | Registered CommenterNollind Whachell

THANK YOU!! Have also been hunting high and low for a way to add image borders xxx

01.18.2009 | Unregistered CommenterChristine

I too am interested in borders around thumbnails. Seems like this should be a standard option to me. Anyway, how can I use your advice on the thumbnails in an image gallery? Also, is there a resource that shows what the available CSS commands are so I could at lease search for thumb and figure it out from there?

Thanks.

11.5.2009 | Unregistered CommenterAlex

For anyone that's interested, here is the code I used and works perfectly for gallery thumbnails.

.picture-gallery-thumbnail-list li .thumbnail-container-tiled { float: left; margin-bottom: 12px; margin-right: 12px; border-style:outset; border-color: gray; border-width:2px; }

I added this at the bottom of the Custom CSS section. Just change the various settings and enjoy.

11.5.2009 | Unregistered CommenterAlex