它只与IE6有关吗?
放大:1?
布局是否只是IE的TAG?
编辑:
我发现这个信息对我来说非常丰富
Because Internet Explorer is so old
(as it was one of the first browsers
available),it hasn’t had the luxury
of starting anew as current browser
do. So as time went by,Microsoft
began adapting new engines to make use
of CSS. Seems fine… However,CSS
changes the fundamental assumption
that Internet Explorer’s engine is
based on – that anything significant
is a rectangle that contains all its
content.So to deal with the new standards of
CSS,Microsoft decided to fix their
ancient engine by implementing the
hasLayout property,instead of
rebuilding IE. Every element in
Internet Explorer now has a hasLayout
property. Depending on the element,it
is set to either true or false by
default. If hasLayout is set to true –
the element is an independent Box that
is responsible for rendering itself.
If false – then the element relies on
a parent element that has hasLayout
set to true to render it. This is
where a majority of IE bugs come to
life.
来源:http://bytesizecss.com/blog/post/fix-haslayout-with-one-line-of-css
我再发现一个这样的讨论:http://www.molly.com/2007/03/30/back-to-work-someone-please-clearly-articulate-haslayout/
解决方法
经典示例是给元素布局,以便清除浮点数.
#wrapper { zoom:1; }
该元素现在将包含浮点数.任何这些属性和值除auto / normal之外都会触发布局属性.
* display: inline-block * height: (any value except auto) * float: (left or right) * position: absolute * width: (any value except auto) * writing-mode: tb-rl * zoom: (any value except normal)