hasLayout属性

在IE中,当一个元素的hasLayout属性被触发后(不可逆转),就会拥有一个布局,可以进行更多的样式更改操作。

包含该属性的元素有

body html/table tr th td/img/hr/input button file select fieldset textarea/frameset iframe frame/objects applets embed

可以通过简单的css设置触发该属性,包括:

* display: inline-block
* height: (任何值除了auto)
* float: (left 或 right)
* position: absolute
* width: (任何值除了auto)
* writing-mode: tb-rl
* zoom: (除 normal 外任意值)

Internet Explorer 7 还有一些额外的属性(不完全列表):

* min-height: (任意值)
* max-height: (除 none 外任意值)
* min-width: (任意值)
* max-width: (除 none 外任意值)
* overflow: (除 visible 外任意值)
* overflow-x: (除 visible 外任意值)
* overflow-y: (除 visible 外任意值)
* position: fixed

有很多IE下的bug都是由hasLayout属性引起的,可以注意。

posted @ 2012-10-23 20:40  AlexDu  阅读(91)  评论(0编辑  收藏  举报