概述:我的页面顶部有一个 CSS3 纯导航系统。我在底部有页脚/版权。
在中间,我想要一个背景图像(羊皮纸)封面,然后在该羊皮纸的顶部,我想要一个带有左栏和右栏的文本的白色图层。我似乎无法使用相对位置使其工作,因为我的 z-index 似乎不起作用。如果我将位置“固定”,我将无法再使用正确的浏览器滚动来向下滚动。如果我使用位置“绝对”,那么背景是正确的,顶部的内容是好的,但是我的导航页脚消失了。如果我使用“相对”位置,我的导航系统很好,但背景不再显示。它忽略了 z-index....
奇怪的是我正在使用表达式 web 4,它在那里看起来是正确的......它在网络上看起来不正确。
这是我的网站 html,用于重现我所看到的内容。
<!-- #BeginEditable "content" -->
<div id="page_content_back">
<div id="column_left">
<h1>About</h1>
<p>We are the best-Trust us</p>
</div>
<div id="column_right">
<h4>CONTACTS</h4>
</div>
</div>
<!-- #EndEditable -->
这是我的CSS
#page_content_back {
position: relative;
background-image:url('../images/grayparchment_back.jpg');
background-size: cover;
z-index: 1;
width: 100%;
margin: auto;
padding: 0;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #CCAA77;
}
#column_left {
position: relative;
margin: 0 50px;
padding: 0 2%;
z-index: 2;
top: 0px;
background-color: #fff;
float: left;
width: 65%;
height: 100%;
color: #393939;
}
#column_right {
position: absolute;
z-index: 3;
float: right;
right: 50px;
top: 370px;
width: 20%;
height: 100%;
margin: 0;
padding: 10px;
background-color: #fff;
}