How to stop IE7 clearing floats because of hasLayo

2019-06-28 02:14发布

问题:

I have a containing element with a number of floated elements in it. That containing element also has a percentage width value applied to it.

In IE7, content following the element containing the floats is cleared because of the width value which gives it hasLayout (I think!).

I don't want the containing element to haveLayout, but I do need it to have an explicit width. Is there a way of working around this problem in IE7, effectively forcing hasLayout=false.

回答1:

You can fix some haslayout rendering problems using:

* {
 zoom: 1.0;
}

Good luck.