html – 什么是haslayout?

前端之家收集整理的这篇文章主要介绍了html – 什么是haslayout?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经阅读了一些文章,但没有得到什么实际.任何人都可以解释我.

它只与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/

解决方法

它是一个HTML元素上的非标准属性,仅由IE7和更低版本(IE8兼容模式)支持,如果触发该元素会以某种方式呈现元素(这可能是意想不到的,随机的,可以是godsend或可以是地狱).

经典示例是给元素布局,以便清除浮点数.

#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)

请仔细阅读@ http://reference.sitepoint.com/css/haslayout

猜你在找的HTML相关文章