当鼠标悬停在链接上时,DIV会在IE7中移动

时间:2012-07-03 14:53:22

标签: css

当鼠标悬停在菜单链接上时,整个DIV在IE 7中向上移动。在Chrome,IE 8,9中,一切都很好。

将鼠标悬停在商店链接上时

DIV的LOGO,搜索,篮子向上移动。

这是我有的CSS ..

.storefinderdropdown { position:absolute; top:8px; float:none; width:270px; height:43px; border:5px solid #F1F1EF; background:#F1F1EF; z-index:10; margin:20px 0 0 335px;  font-size:10px; font-weight:bold; text-indent:3px; padding:0; display:block; }
.storefinderdropdown .SLErrorMsg { display:none; color:#f00; line-height:20px;}
.storefinderdropdown .SLbutton { position:relative;  display:inline; float:left; }
.storefinderdropdown .SLbutton input{ float:left; vertical-align:middle; }
.storefinderdropdown .SLbutton a{ float:left; margin:1px 0 0 3px; line-height:10px;  color: #fff !important; border: none; cursor:pointer; font-weight:bold; width:42px; height:14px;  background-image: linear-gradient(bottom, #335649 13%, #335649 57%, #335649 79%); background-image: -o-linear-gradient(bottom, #335649 13%, #335649 57%, #335649 79%); background-image: -moz-linear-gradient(bottom, #335649 13%, #335649 57%, #335649 79%); background-image: -webkit-linear-gradient(bottom, #335649 13%, #335649 57%, #335649 79%); background-image: -ms-linear-gradient(bottom, #335649 13%, #335649 57%, #335649 79%); background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.13, #335649), color-stop(0.57, #335649), color-stop(0.79, #335649)); background-color:#335649; border-radius:3px; padding: 5px; }

3 个答案:

答案 0 :(得分:1)

我在I.E.中使用了开发人员工具。帮助您解决问题。

问题在于您为#header和.logo

设置的边距
   #header .logo{
    padding-bottom:0px;
    margin-top:15px;
    ....
    }

在I.E.中快速解决此问题并且仍然期望在其他浏览器中使用#header和.logo的padding-top替换margin-top。

希望得到这个帮助。

答案 1 :(得分:1)

好吧,我尝试了你所有的建议......没有一个能为我效劳。问题 是因为#menubar DIV在#logo,#searchbar,#basket DIV之外,而且它在所有DIV之前。

我做的是,只需将div放在所有DIV之后,然后再添加一个DIV包装,这样它就不会移动。

无论如何,谢谢你们的建议。真的很感激。

答案 2 :(得分:0)

我解决了类似的问题 显示:内联块 在主css容器的div所在的样式表中。

相关问题