去除inline-block元素间间距的N种方法

废话不多说直接上货:

解决方法1:

<div class="space">
    <a href="##">
    MM</a><a href="##">
    GG</a><a href="##">
    DD</a>
</div>
或者借助注释:
<div class="space">
    <a href="##">MM</a><!--
    --><a href="##">GG</a><!--
    --><a href="##">DD</a>
</div>

解决方法2:
div class="space">
    <a href="##">MM
    <a href="##">GG
    <a href="##">DD</a>
</div>

解决方法3:font-size:0px;
.space {
    font-size: 0;
}
.space a {
    font-size: 12px;
}

决解方法4:letter-spacing:0px;
.space {
    letter-spacing: -3px;
}
.space a {
    letter-spacing: 0;
}

解决方法5:word-spacing:0px;

.space {
    word-spacing: -6px;
}
.space a {
    word-spacing: 0;
}

解决方法6:margin负值:

这个根据不同上下文字体大小决定:
 
posted @ 2017-03-06 12:29  乡野村夫28  阅读(93)  评论(0编辑  收藏  举报