-1
我想要調整z索引順序,以便第一個類比第二個類更接近。CSS Z-Index問題
但我不能爲我的生活得到一個盒子陰影來顯示。
.title {
background-image: linear-gradient(bottom, rgb(249,252,249) 33%, rgb(255,255,255) 37%);
background-image: -o-linear-gradient(bottom, rgb(249,252,249) 33%, rgb(255,255,255) 37%);
background-image: -moz-linear-gradient(bottom, rgb(249,252,249) 33%, rgb(255,255,255) 37%);
background-image: -webkit-linear-gradient(bottom, rgb(249,252,249) 33%, rgb(255,255,255) 37%);
background-image: -ms-linear-gradient(bottom, rgb(249,252,249) 33%, rgb(255,255,255) 37%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.33, rgb(249,252,249)),
color-stop(0.37, rgb(255,255,255))
);
box-shadow: 0px 1px 5px rgba(0,0,0,1);
height: 50px;
z-index: 1;
}
.banner {
background-image:url('images/grad.jpg');
background-color:#cccccc;
height: 500px;
z-index: -1;
}
但這不適用於我。
標記>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Design Test | PolyDevs</title>
<link rel="stylesheet" type="text/css" href="style.css">
<div class="header">
<div class="title">
<div class="logo">
<img src="images/banner.png"/>
</div>
</div>
</div>
</head>
<body>
<div class="banner">
</div>
</body>
</html>
請發佈您的HTML –
你能分享你的標記(HTML)嗎? 'z-index'是[設置相對](http://stackoverflow.com/questions/7482840/z-index-order-for-draggable-div/7482870#7482870)所以你的標記很重要... –
是父母橫幅設置爲'position:relative'的元素?我知道這是絆倒了我過去 – aviemet