2012-07-03 53 views
0

將鼠標懸停在菜單鏈接上時,整個DIV在IE 7中向上移動。在Chrome 8,9中,一切正常。將鼠標懸停在鏈接上時,DIV在IE7中移動

當您將鼠標懸停在商店鏈接上時。 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; } 
+0

我在IE7模式下沒有看到使用IE9的這種行爲。 –

回答

1

嗯,我試過你的所有建議......他們都沒有爲我工作。問題 原因是因爲#menubar DIV在#logo,#searchbar,#basket DIV之外,並且它在所有DIV之前。

我所做的只是將div放在所有這些DIV之後,並在其周圍添加一個DIV包裝,使其不移動。

無論如何,謝謝你們的建議。真的很感激它。

1

I.E.幫助您解決問題。

它出現的問題在於,你已經設置的#header和.logo

#header .logo{ 
    padding-bottom:0px; 
    margin-top:15px; 
    .... 
    } 

速戰速決爲即,該問題保證金並且仍然期望在其他瀏覽器中得到相同的結果是用#header和.logo的padding-top替換margin-top。

希望得到這個幫助。

+0

opps,對不起。罪魁禍首是#header .logo A {...} –

+0

風格的地方是的,你的方式也應該有效。 =) –

0

我解決了類似的問題 display:inline-block 在div所在的主CSS容器的樣式表中。

相關問題