锚点标签元素之间的CSS不必要间距 [英] CSS unwanted spacing between anchor-tag elements
本文介绍了锚点标签元素之间的CSS不必要间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个样式表:
* {
padding:0px;
margin:0px;
}
a {
背景:黄色;
}
和此网页:
< a href =/ blog />首页< / a>
< a href =/ about />关于< / a>
< a href =/ contact />联系人< / a>
结果:
如何将这些锚标签
$ b < >解决方案
您需要删除标签之间的空格(在这种情况下是换行符)。某些浏览器会将其显示为空格。
I have this stylesheet:
*{
padding: 0px;
margin: 0px;
}
a{
background:yellow;
}
and this webpage:
<a href="/blog/">Home</a>
<a href="/about/">About</a>
<a href="/contact/">Contact</a>
Results in:
How do I make those anchor tag to "touch" each other,removing that unwanted space in-between?
thanks Luca
解决方案
You need to remove the whitespace (in this case the newline) between your tags. Some browsers render it as a space.
这篇关于锚点标签元素之间的CSS不必要间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文