Skip to content

Instantly share code, notes, and snippets.

@coolicer
Created March 8, 2013 06:42
Show Gist options
  • Save coolicer/5114642 to your computer and use it in GitHub Desktop.
Save coolicer/5114642 to your computer and use it in GitHub Desktop.
cross brower inline-block
.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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment