我试图将图像覆盖在两个div列上 - 我尝试使用Z-index。并玩弄我所知道的定位属性。如何覆盖图像
我在做什么错。两个盒子后面的三角形,以及您在JSFiddle中看到的其他文字,都应放在径向渐变[ed]框的顶部。
#background-wrapper {
margin: 0 auto;
margin-top: 25px;
width: 1024px;
}
body {
background-color: #666;
}
body {
background-image: url("images/background-01.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
}
.container-01 {
position: absolute;
margin: 50px 50px;
width: 380px;
height: 160px;
opacity: .65;
background: #555; /* For browsers that do not support gradients */
background: -webkit-radial-gradient(circle, black, grey, white); /* Safari */
background: -o-radial-gradient(circle, black, grey, white); /* Opera 11.6 to 12.0 */
background: -moz-radial-gradient(circle, black, grey, white); /* Firefox 3.6 to 15 */
background: radial-gradient(circle, black, grey, white); /* Standard syntax */
z-index: 1
}
}
#trident {
clear: both;
left: 50px;
z-index: 2;
}
.container-01-box {
position: relative;
margin: 60px 60px;
width: 360px;
height: 140px;
background: #555; /* For browsers that do not support gradients */
background: -webkit-radial-gradient(circle, black, grey, white); /* Safari */
background: -o-radial-gradient(circle, black, grey, white); /* Opera 11.6 to 12.0 */
background: -moz-radial-gradient(circle, black, grey, white); /* Firefox 3.6 to 15 */
background: radial-gradient(circle, black, grey, white); /* Standard syntax */
z-index: 1
}
<title>UNAWAKENED.NET - Welcome!</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<section id="background-wrapper">
<header>_</header>
<div class="container-01"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Penrose-dreieck.svg/526px-Penrose-dreieck.svg.png" id="trident" alt="Triangle" width="100"><h1 id="top-box">Featured Dream</h1></div>
<div class="container-01-box"><h1 id="name-of-dream">"The ships from Nova"</h1></div>
</body>
这对unawakened.net如果有人好奇。如果你找到答案,请解释一下逻辑!
在此先感谢。
[Rü这样看?差不多都是http://jsfiddle.net/sureshponnukalai/e73ys781/ –
。我要检查你的代码。但是我希望元素完全在盒子上面。没有混合。 我看着它,你做了什么? :) – Sidhartha
我刚刚改变了'z-index:1'到'z-index:100'为'container-01'类 –