2012-09-05 31 views
0

以兼容模式運行以下佈局時,內容會在固定標題後消失。有沒有辦法阻止這種情況發生?爲什麼我的內容在兼容模式下在我的標題後消失?

查看jsfiddle here並在IE中兼容模式之間切換。在不兼容模式下,Layout可以在Chrome和IE9中正常工作。

部首的CSS基本上是:

#headerContainer 
{ 
    position: fixed;  
    top:0px; 
    z-index:999; 
    background:green; 
    width: 100%; 
} 

和內容的CSS是:

#container{ 
overflow:hidden; 
padding-left:480px; /* The width of the rail */ 
margin-top: 135px; 
background: red; 
} 

及其固定流體佈局(左導軌是固定的)與一個固定的標頭。向下滾動時,我希望頁面內容在標題下消失。

+0

所以你想要它通過頭? – Kyle

+0

沒有我希望頭部保持固定,並且滾動時內容會在其下面消失 - 這就是它在兼容模式關閉時的行爲方式 – woggles

回答

1

對IE兼容模式快速修復:

#container{ 
    overflow:hidden; 
    padding-left:480px; /* The width of the rail */ 
    margin-top: 135px; 
    background: red; 
    *position:relative; 
    *top:135px; 
} 

我用CSS破解(與*)爲IE7。 小提琴:http://jsfiddle.net/keaukraine/phPAN/

+0

謝謝...效果超棒:) – woggles

相關問題