layout-trigger | triggers layout in | reset | issues | |||||||
---|---|---|---|---|---|---|---|---|---|---|
IE 5 | IE 5.5 | IE 6 1 | IE 7 1 | |||||||
inline | block | inline | block | inline | block | inline | block | |||
position: absolute |
yes | yes | yes | yes | yes | yes | yes | yes | static or relative |
Refers to its containing block, and that's where some problems begin. |
float: left|right |
yes | yes | yes | yes | yes | yes | yes | yes | none |
The float model has a lot of quirks due to some aspects of a layout element. |
display: inline-block2 |
no | no | yes | yes | yes | yes | yes | yes | no reset with block or inline in any other ruleset |
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 other value than auto |
yes | yes | yes | yes | no | yes | no | yes | auto |
This is often an implicit fix, more often the trigger when hasLayout does things wrong. |
height any other value than auto |
yes | yes | yes | yes | no | yes | no | yes | auto |
|
zoom: any value other than normal (MSDN) |
no | no | yes | yes | yes | yes | yes | yes | normal |
|
writing-mode: tb-rl (MSDN) |
no | no | yes | yes | yes | yes | yes | yes | lr-tb |
MS proprietary, not valid |
overflow: hidden|scroll|auto |
no | no | no | no | no | no | no | yes | visible |
This property did not apply in IE < 7, unless “layout” was added to the box by other triggers. |
overflow-x|-y: hidden|scroll|auto |
no | no | no | no | no | no | no | yes | visible |
As part of the CSS3 box model module, overflow-x and -y are not widely implemented yet. |
position:fixed |
no | no | no | no | no | no | yes | yes | static or relative |
|
min-width: any value |
no | no | no | no | no | no | no | yes | auto (not valid) |
Even the value 0 lets the element gain layout. |
min-height: any value |
no | no | no | no | no | no | no | yes | auto (not valid) |
Even the value 0 lets the element gain layout. |
max-width: any value other than 'none' |
no | no | no | no | no | no | no | yes | none |
|
max-height: any value other than 'none' |
no | no | no | no | no | no | no | yes | none |
CSS Filter/Hacks | Conditional Comments | Mixture of CSS Filter/Hacks and Conditional Comments |
---|---|---|
Description | ||
use of CSS browser bugs to separate styles within style sheet | use of MS-proprietary HTML comments: conditional comments | one stylesheet for all IEs via conditional comment; separation with CSS hacks |
Syntax | ||
|
|
|
Pros | ||
|
|
|
Cons | ||
|
|
|
Whatever method you choose, whatever hack you use – do it with care…
This “Thoughts on IE hack management” chapter is part of the article On having layout.