Discussion Locked

Fixing float margins in IE

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

This week's Design and Usability Tactics newsletter describes two ways to fix float margins in IE. One involves a simple CSS hack. The second solution is hack-free, but it requires rethinking the approach to specifying the spacing between the boxes.

How do you deal with browser problems such as IE's doubled margins on floats? Do you have a favorite alternative to a commonly used CSS hack? Or, do you think it's not worth the trouble to search for a hack-free alternative when there's a documented hack available that addresses the problem?

1 reply

by dlwaters

In this case, I'd rather use the hack, than the CSS fix, because the CSS fix of padding the left side limits the placement of further content to being 100px from the left edge, unless you apply negative margins to other contained elements. I have found, in general, that padding an enclosing box can often cause design problems down the line. I frequently use background colors applied to my

tags when I want a heading to act as a divider that spans the entire width of a container box, so padding at the container level throws this off.

I believe I have accidentally come across the "inline" hack while trying to fix IE problems before (having no clue why it worked!) It is nice to have confirmation of this technique, even if it is a hack. Thanks!

Dean L Waters

This discussion is closed to new replies.