0

I'm trying to put a solid border around an image but the spacing around the image varies in IE and other browsers and isn't a consistant on all 4 sides.

 <div style="float:right; border:1px solid #666666; padding: 2px;2px;2px;2px;">
 <img src="images/image.jpg" alt="mining"/>
 </div>
Skye Lans
  • 41
  • 1
  • 7
  • possible duplicate of [Mysterious padding/margin appears after image in strict mode](http://stackoverflow.com/questions/6405009/mysterious-padding-margin-appears-after-image-in-strict-mode) – James Montagne Apr 30 '13 at 19:08

1 Answers1

1

Just images being .. images. Adding display: block; to the img will solve your issue.

http://jsfiddle.net/BnB4D/2/

By the way that's not how you declare multiple values (the padding), you should use padding: 2px; or padding: 2px 2px 2px 2px; but 2px;2px;2px;2px; actually takes just the first value and ends after the first ;

Kaloyan
  • 7,262
  • 4
  • 32
  • 47