I'm just learning the ropes on clearing floats for all browsers and had and idea.
Do you see any harm in defining this globally for all div
elements?
div {
_zoom: 1; /* Clear floats for ie6. Does NOT validate. */
overflow: hidden; /* Clear floats for all other browsers. */
}
There would probably only be a few special cases where the above two rules would need to be overwritten. Off the top of my head, I can't think of any problems that might come up as a result of the above rule, but maybe someone knows better?
What do you think?
EDIT 1:
Changed height: 100%;
to _height: 1%;
.
EDIT 2:
Changed _height: 1%;
to _zoom: 1;
.
This is the version I'm running with. Here is an excellent link to an article describing all clearing methods for newbies.