Skip to content

Instantly share code, notes, and snippets.

@liveme
Created March 21, 2014 06:16
Show Gist options
  • Save liveme/9680599 to your computer and use it in GitHub Desktop.
Save liveme/9680599 to your computer and use it in GitHub Desktop.
inline-block清除空隙
/*
*@ 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