Skye Lans
Skye Lans

Reputation: 41

css equal border around image on all browsers

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>

Upvotes: 0

Views: 102

Answers (1)

Kaloyan
Kaloyan

Reputation: 7352

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 ;

Upvotes: 1

Related Questions