IE nested boxes (padding-top/margin-top)

Atom RSS

This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.

Main navigation:




Search reports by browser:

For nested boxes IE doesn't add the outer box padding and the inner box margin, as all other browsers do.

Test page Workaround is not included
Reported by: Daniel Bleisch.

Explorer 5-6 Windows, Explorer 7 beta 2 | Reported on 26 January 2005.

Comments

(Add your own)

Posted by Vesa Piittinen on 26 January 2005

1

To be more specific, IE seems to misbehave with top padding only. A workaround to this is to have a layer, for example and then add a separate stylesheet for IE using a conditional comment ( http://www.quirksmode.org/css/condcom.html ). You also must have font-size : 1px; in the style for the padding fix if the height is smaller than the size of font (because IE thinks minimum height for a layer is the size of the font).

You can see this tip in practical use at http://firefox.maayas.net (see div.img-header).

CSS files to check out (as there are many CSS files used in the page):
http://firefox.maayas.net/tutuksi.css
http://firefox.maayas.net/tutuksi-ie.css

Posted by Gérard Talbot on 3 July 2005

2

I believe the bug disappears (in MSIE 6) if you remove width:360px. In other words, the layout of the s were overconstrained to begin with.

Post a comment

Commenting guidelines:

  1. When quoting specs, articles or your own research, please include a URL of the document.
  2. Test your stuff. When reporting browser behaviour, make sure that your report is correct.

Yes