Internet Explorer 7 Margin Bug

Wednesday, March 4th 6:08pm Matt

My dream of dreams is that Microsoft get out of the browser game. Don’t they see they’re only causing trouble? Today when working on some changes to the theme for Doxie News I realized that the first paragraph of every post was ignoring it’s margin-left. It appeared to be only margin-left, all the other properties, including margin-bottom worked. It also didn’t matter whether I specified it as margin-left or as part of margin.

I did some searching and found a work around. Apparently margins on nested blocks in Internet Explorer are buggy. To get things back into shape, you can force the parent, in my case a div, to “have layout” by specifying min-height of 1px. After that, margin-left starts working again.

1

Amelia Vargo

Friday, March 6th 12:48am

As a mac user I couldn’t agree more :) Thanks for the tip about min-height, that’s the kind of gold dust that you can spend ages searching for.

2

Matt

Friday, March 6th 9:42am

Yeah, that’s what though about the min-height thing too. I know other people are going to have to search for that.

Submit a Comment