2

Why are my links becoming disabled when I try to make the span they are in float right?

HTML:

<span id="spnLoginRegister">
    <a href="login.htmls" type="text/html">Login</a>
    | 
    <a href="register.html" type="text/html">Register</a>
</span>

CSS:

#spnLoginRegister{
    position: relative;
    right: 0px;
    font-size: 20px;
    margin-top: -10px;
}

-- or --

#spnLoginRegister{
    float: right;
    font-size: 20px;
    margin-top: -10px;
}

Both of these CSS methods disable to links. Then I remove the float: right; part, the links work just fine. I feel like the solution is very simple but I'm just not seeing it.

Here is the link the the site: http://friendshipodyssey.com/

4

3 回答 3

3

当我看到您的在线页面时,您必须删除此属性:

position: relative;

从这个 id :

#hgpHeaders

并且您的问题得到解决。

于 2014-03-31T05:37:01.780 回答
0

您的代码中没有问题: jsfiddle + jsfiddle

请检查您的其他 CSS 代码,最好使用这样的<span>标签:

<a href="login.htmls" type="text/html"><span>Login</span></a> 

尝试使用<div>而不是<span>

于 2014-03-31T05:20:53.717 回答
0

我检查了你的网站, http: //friendshipodyssey.com/

解决方案:

只需将 span id="spnLoginRegister" & hgroup id="hgpHeaders" 放在 DIV 中,并将 CSS 属性设为 width: 100% & height:150px,

同样对于#hgpHeaders,应用CSS 属性float:left。

希望它能解决你的问题

于 2014-03-31T05:56:05.460 回答