General discussion

Locked

Fixing float margins in IE

By MaryWeilage Editor ·
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?

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

I'd rather use the hack

by dlwaters In reply to Fixing float margins in I ...

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 <h1><h2> 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

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums