Add padding to images in IE

April 20, 2006 – 21:43 | web-design

An IE quirks mode issue I ran into:

Evidently, this,

CSS:
  1. img { display: block; border: 1px solid #999999; padding: 15px; }

will not put a 15px wide "moat" between an image and its border in IE 6 (works well in Firefox). The workaround is to add a 'div' around the image, and set the above properties to the div.

Trackback from your site, or follow the comments in RSS.

Post a Comment