论hasLayout
1.Resetting hasLayout:
width, height
(to 'auto')max-width, max-height
(to 'none') (in IE 7)position
(to 'static')float
(to 'none')overflow
(to 'visible') (in IE 7)zoom
(to 'normal')writing-mode
(from 'tb-rl' to 'lr-tb')
2.css Properties hack
position: absolute
- Refers to its containing block, and that's where some problems begin.
float: left|right
- The float model has a lot of quirks due to some aspects of a layout element.
display: inline-block
- Sometimes a cure when the element is at inline level and needs layout. Applying layout is probably the only real effect of this property. The “inline-block behaviour” itself can be achieved in IE, but quite independently: IE/Win: inline-block and hasLayout.
width: any value other than 'auto'
- This is often an implicit fix, more often the trigger when hasLayout does things wrong.
height: any value other than 'auto'
- height: 1% is used in the Holly Hack.
zoom: any value other than 'normal'
(MSDN)- MS proprietary, does not validate.
zoom: 1
can be used for debugging. writing-mode: tb-rl
(MSDN)- MS proprietary, does not validate.