Created
April 16, 2014 07:10
-
-
Save lvwzhen/10821850 to your computer and use it in GitHub Desktop.
inline-block 空白间隙解决方案
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.dib-wrap { | |
font-size:0;/* 所有浏览器 */ | |
*word-spacing:-1px;/* IE6、7 */ | |
} | |
.dib-wrap .dib{ | |
font-size: 12px; | |
letter-spacing: normal; | |
word-spacing: normal; | |
vertical-align:top; | |
} | |
@media screen and (-webkit-min-device-pixel-ratio:0){ | |
/* firefox 中 letter-spacing 会导致脱离普通流的元素水平位移 */ | |
.dib-wrap{ | |
letter-spacing:-5px;/* Safari 等不支持字体大小为 0 的浏览器, N 根据父级字体调节*/ | |
} | |
} | |
.dib { | |
display: inline-block; | |
*display:inline; | |
*zoom:1; | |
} | |
/*YUI inline-block*/ | |
.yui3-g { | |
letter-spacing: -0.31em; /* webkit: collapse white-space between units */ | |
*letter-spacing: normal; /* reset IE < 8 */ | |
word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */ | |
} | |
.yui3-u { | |
display: inline-block; | |
zoom: 1; *display: inline; /* IE < 8: fake inline-block */ | |
letter-spacing: normal; | |
word-spacing: normal; | |
vertical-align: top; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment