Created
March 21, 2014 06:16
-
-
Save liveme/9680599 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
/* | |
*@ Name: display: inline-block; | |
*@ Update: 2013-06-27 | |
*@ Doc: http://www.iyunlu.com/view/css-xhtml/64.html | |
*@ Usage: 若需清除空隙,则在外层容器加上 .dib-wrap | |
*/ | |
.dib { | |
display: inline-block; | |
*display: inline; | |
*zoom: 1; | |
} | |
.dib-wrap { | |
font-size: 0; /* 所有浏览器 */ | |
*word-spacing: -1px; /* IE6/7 */ | |
} | |
@media (-webkit-min-device-pixel-ratio:0) { | |
.dib-wrap { | |
letter-spacing: -5px; /* Safari 5- 等不支持 font-size: 0 的浏览器*/ | |
} | |
} | |
.dib-wrap .dib { | |
vertical-align: top; | |
font-size: 12px; | |
letter-spacing: normal; | |
word-spacing: normal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment