链接之间的未知空间 [英] Unknown space between links

查看:143
本文介绍了链接之间的未知空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个链接:

<a href="/about" class="f_link">&nbsp;&nbsp;&nbsp;About&nbsp;&nbsp;&nbsp;</a>
<a href="/Login" class="f_link">&nbsp;&nbsp;&nbsp;Login&nbsp;&nbsp;&nbsp;</a>
<a href="/Create Account" class="f_link">&nbsp;&nbsp;&nbsp;Create Account&nbsp;&nbsp;&nbsp;</a>

我有一些CSS样式:

.f_link{
height:38px;
padding-top:12px;
margin:0px;
color:gray;
}
.f_link:hover{
color:black;
text-decoration:none;
}

这个html如何显示在FF 3.6,IE 8和一些版本Google Chrome:

How this html is displayed in FF 3.6, IE 8, and some version of Google Chrome:

这是我想要在我的三个主要浏览器中显示:

And this is how I would like it to be displayed in my three major browers:

我使用firebug,它说这些链接之间没有填充或边距。那里的那个空间是什么,我怎么能摆脱它呢?

I used firebug and it said there is no padding or margin between these links. What is that space there for then, and how can I get rid of it? I'm open to suggestions!

推荐答案

换行符/应在HTML中视为一个空格。您可以将此标记更新为此标记(在结束标记之前换行,但在下一个A标记之前没有空格)

Line breaks are/should be treated as a single white space in HTML. You can update your markup to this (line break before the closing tag, but no space before the next A tag)

<a href="/about" class="f_link">&nbsp;&nbsp;&nbsp;About&nbsp;&nbsp;&nbsp;
</a><a href="/Login" class="f_link">&nbsp;&nbsp;&nbsp;Login&nbsp;&nbsp;&nbsp;
</a><a href="/Create Account" class="f_link">&nbsp;&nbsp;&nbsp;Create Account&nbsp;&nbsp;&nbsp;</a>

这篇关于链接之间的未知空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆