我正在尝试调整 z 索引顺序,以使第一类比第二类更接近。
但我一辈子都不能得到一个盒子阴影来显示。
.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>