我在SO上找到的每個問題都列出了z-index修復程序作爲解決方案。不幸的是,這似乎不適合我。相對Div內的IE7絕對Div消失。 z-index不能解決問題
這裏是我的結構:
- 體
- 格包裝
- 格頭
- 格主
- DIV頁面容器
- DIV頁面backgro UND圖像
- DIV頁面底部梯度
- DIV頁面backgro UND圖像
- DIV初級
- DIV左菜單
- DIV外容器
- 等...
- DIV頁面容器
- 格頁腳
這裏的CSS
body {
color: #666;
font-size: 12px;
line-height: 18px;
background: url(images/bg-stripes.gif) repeat bottom left;
font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
border: 0;
margin: 0;
padding: 0;
vertical-align: baseline;
}
#wrapper {
position: relative;
margin: 0 auto;
width: 1280px;
padding-top: 30px;
background: transparent;
vertical-align: baseline;
z-index: 0;
}
#main {
position: relative;
clear: both;
overflow: hidden;
padding: 0 0 0 0;
background: #DDD;
z-index: 0;
margin: 0 auto;
width: 1280px;
}
#page-container {
padding: 0 0 0 0;
position: relative;
z-index: 2;
}
#page-background-image {
position: absolute;
left: 0;
top: 0;
width: 460px;
height: auto;
z-index: 1;
overflow: hidden;
}
看來,結構中的加粗部分上面被放置在主DIV後面。刪除「位置:絕對;」從#頁面背景圖像修復了這個問題,但顯然刪除了絕對位置並擰緊了佈局。無論我使用從高到低索引還是從低到高,爲樹中的每個元素設置z索引都不會改變任何事情。會不會有另一個問題導致這種影響?我寧願不要將其設置爲背景圖像,因爲圖像會被動態地拉動和放置。
請發佈一個活生生的例子,裏面有一些示例文本:) – 2011-10-05 14:36:44