- 1, Display:inline-block
- 2. Inline-block in IE
- 3. Other browsers
1, Display:inline-block
Allows an element to have the attribute of the chunk element (which can be set to width and height) and the property of an inline element (no wrapping is generated).
2. Inline-block in IE
IE6 does not support this property, but IE8 begins to support this property.
Inline-block characteristics of IE6 inline elements
Since Inline-block will trigger the layout of IE, as long as the IE6 set {display:inline-block;} Can.
There are two ways to let IE6 block elements have inline-block attributes.
A, you can trigger the layout, and then set to inline, it should be noted that the two display must be in two CSS declarations to be valid, the code is as follows:
div { width:400px; height:200px; Display:inline-block;} div { display:inline;}
B, directly set to inline, then use zoom to trigger layout to achieve similar effects:
div { width:400px; height:200px; *display:inline; *zoom:1;}
3. Other browsers
This property is supported by other browsers, but Firefox does not support this property until 3.0, and the previous version can use its private property {Display:-moz-inline-box} to achieve a similar effect. But you can also ignore versions prior to 3.0 (these versions of browsers are rarely used).
The Display:inline-block in CSS