1781 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+5 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.. :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by