Help - Search - Members - Calendar
Full Version: Borders around PHOTOS
Movable Type Community Forum > Additional Resources > Tips and Tricks
allisonv7
Hey,

I just put together a quick photolog at:

http://www.flatlevelground.com/mt/photo

My pictures are getting lost on the black background though, is there anyway to add a border around them through CSS? Or is this something that I'm going to have to do in photoshop??  I'm not to infromed on CSS yet.... sad.gif

allison.
tonynguyen
2 ways of doing this. smile.gif

1) make a border in the img tag.

[img]blah.jpg[/img]

2) do it in css.

img { border: 1px #FFF;}
tonynguyen
2 ways of doing this. smile.gif

1) make a border in the img tag.

CODE
<img src="blah.jpg" border="1">


2) do it in css.

img { border: 1px #FFF;}
allisonv7
I tried that...didn't work sad.gif


For the CSS one do I have to put anything in the actual index files? or just the stylesheet....I've tried it both ways but it still doesn't work.


allison.
phidauex
I don't want borders around all my images, only some of them, so I specify a photo class in my CSS. Here is my code:

CODE
.photo {
   margin:8px;
   border:1px solid;
}


Then I do my photo's image tags like this:

CODE
<img src="/images/blah.jpg" alt="Blah pic" width="32" height="52" class="photo" />


The alt and width/height tags are there for xhtml compliance, and then specifying the class has it use the CSS to style it, giving it an 8 pixel margin, and a 1 pixel solid border. You can of course specify colors and various thicknesses and style for the border, I just use a very simple one. That should work fine for you, assuming your stylesheet is working properly in general.

Peace,
sam
maddy
Try instead:
CODE
img {
    border: 3px #fff solid;
}


Note that will automatically put a 1 pixel wide, solid white border around EVERY image tag on your page. I guess you could get around that by creating an element in your stylesheet in relation to the 'blogbody' part of your page (or whatever you have named the div id enclosing your entries), such as

 
CODE
div#blogbody img {
    border: 5px yellow solid;
}


Hope that helps. smile.gif
maddy
Or as Sam suggested. I got distracted while posting, but he makes good points! biggrin.gif Now, back to my distractin. wink.gif
phidauex
Thanks to the flexibility of CSS, there are quite a few good ways to do it, and we've seen three good ones so far. smile.gif Hopefully you'll find one of these does the trick for you.

Peace,
sam
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.