1666 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Europe
+1 more
Firsh says

I was looking for a solution and there is plenty. Some use CSS 2 .1 pseudo classes some CSS3 .. I’m still using Firefox 3.0.16 because I created a firefox skin and customized it so it won’t work well with an update, and I don’t have time yet to do the update.. Whatever.

What I’m trying to say, is that there is a very very easy and possibly overlooked feature to have double borders on images without any wrapper div or trickery. Somehow my google findings didn’t cover this:

img {
    background:#FFF;
    border:1px solid #9A9A9A;
    padding:5px;
    margin:5px;
}

Only trick is to add some padding and a background color. The “backround” will be the first “frame”.

While I’m at it, if you are including an image inside a wall of text, you’ll probably align it left or right.. Nothing looks worse than if the image has unnecessary margin on the other side where is no text. Let this jQuery snippet add a class to the image whether it’s left or right aligned then a CSS class can remove the obsolete margin:

$('img[align=left]').addClass('leftimg');
$('img[align=right]').addClass('rightimg');
.leftimg{
    margin-left:0px;
}
.rightimg {
    margin-right:0px;
}

Or a shorter way but I prefer settings styles in the CSS ..

$('img[align=left]').css('margin-left', '0px');
$('img[align=right]').css('margin-right', '0px');

This was my 1000th post and decided to write something useful.. :)

by
by
by
by
by
by