Add something like..
a.fancybox img { border:1px solid #000; margin:2px 2px 0 0; }
..to your stylesheet.
Larger border or margins will result in 3 images per row ..
Edit the style.css file in your theme folder as follows—add this line of code:
.attachment-thumbnail {padding:5px;border:2px solid #ccc}
Customize padding, border width and border color values to your liking. HTH
You ideally shouldn’t use padding, the box model for browsers differ, some browsers will include padding in the total width of an element, others won’t, giving you inconsistent display across browsers, margins don’t have that problem.
Previous suggested code could just as easily be..
a.fancybox img.attachment-thumbnail { border:1px solid #000; margin:2px 2px 0 0; }
I’d be inclined to include the fancy box class as part of the definition since it was brought up by the poster, else you’re targetting all attachment thumbnails.
Thanks a lot for your fast reply. I have edit my style.css file with the code:
a.fancybox img.attachment-thumbnail { border:1px solid #000; margin:2px 2px 0 0; }
and I tried
a.fancybox img { border:1px solid #000; margin:2px 2px 0 0; }
But it doesn’t work 🙁
So I removed the code again. Any other suggestions?
I am not really familiar with css or php. So maybe a strange question but does it matter where you put it within the style.css?
Thanks!
If you’re placing it at the bottom of the stylesheet already, try this instead.
a.fancybox img.attachment-thumbnail { border:1px solid #000!important; margin:2px 2px 0 0!important; }
..else just move the code to the bottom.
Bottom most rules usually apply, but there is an ordering scheme to what rules win out, ID’s for example have a higher priority then classes (iirc). I can’t remember specifics or which wins out in the various cases, but “generally” the bottom most rule applies.
Thanks for your help again. I used
a.fancybox img.attachment-thumbnail { border:1px solid #000; margin:2px 2px 0 0; }
at the style sheet of the fancybox plugin and it worked. First, I only tried it at my normal style.css file of my theme.
Thanks!!
t31-thx for the padding v. margin points, I’ll keep them in mind!