<分区>
谁能解释一下为什么 anchor 标记之间有空白,以及如何在不使用负值的情况下删除它,例如 margin 属性?
a {
margin: 0;
padding: 5px;
border: 1px #6BBFDB solid;
text-decoration: none;
color: #6BBFDB;
background-color: #888;
border-radius: 3px;
}
a:hover {
background-color: #999;
}
a:visited {
color: #6BBFDB;
}
<div class="container">
<a href="#">What is this whitespace? -></a>
<a href="#"><- What is this whitespace?</a>
</div>
我以前没见过这个,可能是因为总是希望 anchor 之间有空间,但这次我不希望 anchor 之间有空间,所以这就是我第一次偶然发现这个问题的原因。