Float正在破坏网站上的链接

时间:2015-05-15 09:33:29

标签: html css

我的网站上有一个div,其中包含span类。其中一个意味着有一个mailto:链接,但是,似乎因为div是浮动的,链接不起作用。如果我删除浮动,一切都按预期工作。

HTML:

<div class="topMenu">
 <div class="contactInfo">
  <span class="topMenuSpan">call us:</span><span class="topMenuInfo"> 01892   704 201</span> &nbsp; &nbsp; &nbsp; &nbsp;
 <span class="topMenuSpan"><a href="http://www.google.com">email us:</a></span>
 <span class="topMenuInfo">info@doyouknowbonobo.co.uk</span></div></a>
</div>

CSS:

.topMenu{
height:36px;
background:#000;
font-family: adelle-sans;
font-weight:600;
font-size:15px;
color:#fff;
text-align:right;
float:right;
position:relative;
right:5.7%;
width:612px;
}

.topMenuSpan{
color:#ffdc31;
cursor:pointer;
}

.topMenuInfo{
color:#fff;
cursor:pointer;
}

.topMenu .contactInfo{
cursor:pointer;
position:relative;
right: 15%;
top: 5px;
}

.topMenuSpan:hover{
color:#fff;
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
transition:.5s;
cursor:pointer;
}

.topMenuInfo:hover{
color:#ffdc33;
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
transition:.5s;
}

网站链接:http://scottadmin.co.uk/monkey/

如何阻止浮动链断开?

1 个答案:

答案 0 :(得分:2)

链接没有被破坏 - 它只是不在前台。尝试添加:

.topMenu{
z-index:100;
}