display:none | inline | block | list-item | inline-block | table | inline-table | table-caption | table-cell | table-row | table-row-group | table-column | table-column-group | table-footer-group | table-header-group | run-in | box | inline-box | flexbox | inline-flexbox | flex | inline-flex
默认值:inline
适用于:所有元素
继承性:无
动画性:否
计算值:指定值,除浮动,绝对定位和根元素外
媒体:视觉
IE6,7支持inline元素转换成inline-block,但不支持block元素转换成inline-block,所以非inline元素在IE6,7下要转换成inline-block,需先转换成inline,然后触发hasLayout,以此来获得和inline-block类似的效果;你可以这样:
全兼容的inline-block:
div {
display: inline-block;
*display: inline;
*zoom: 1;
}
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support #1 | 6.0+ | 2.0+ | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
inline-block | 6.0-7.0 #3 | 2.0+ | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
8.0+ | ||||||||
table系 #2 | 6.0-7.0 | 2.0+ | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
8.0+ | ||||||||
run-in | 6.0-7.0 | 2.0-25.0 | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
8.0+ | 26.0+ | |||||||
box | inline-box | 6.0-11.0 | 2.0-38.0 -moz- |
4.0-43.0 -webkit- |
3.1-8.1 -webkit- |
15.0-28.0 -webkit- |
3.2-8.1 -webkit- |
2.1-4.4.4 -webkit- |
18.0-40.0 -webkit- |
flexbox | inline-flexbox | 6.0-9.0 | 2.0-38.0 | 4.0-43.0 | 3.1-8.1 | 15.0-28.0 | 3.2-8.1 | 2.1-4.4.4 | 18.0-40.0 |
10.0-11.0 -ms- |
||||||||
flex | inline-flex | 6.0-10.0 | 2.0-21.0 | 4.0-20.0 | 6.0 | 15.0+-webkit- | 6.0-6.1 | 2.1-4.3 | 18.0-19.0 |
11.0+ | 22.0+ | 21.0+-webkit- | 6.1+-webkit- | 17.0+ | 7.0+-webkit- | 4.4+ | 20.0+-webkit- | |
29.0+ | 9.0+ | 9.0+ | 28.0+ |