层图~
z-index: 默认是0,最高无线~ 999
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#content{
width: 300px;
padding: 0px;
margin: 0px;
overflow: hidden;
font-size: 12px;
line-height: 25px;
border: 2px solid #8d4654;
}
ul,li{
padding: 0px;
margin: 0px;
list-style: none;
}
#content{
position: relative;
}
.tipText,.tipBg{
position: absolute;
width: 380px;
height: 25px;
top: 363px;
}
.tipText{
color: white;
z-index: 1;
}
.tipBg{
background: #000000;
opacity: 0.5;/*背景透明度*/
}
</style>
</head>
<body>
<div id="content">
<ul>
<li><img src="images/nan.jpg"></li>
<li class="tipText">学习微服务,尽在B站</li>
<li class="tipBg"></li>
<li>时间: 9999-99-99</li>
<li>地点: 火星一号</li>
</ul>
</div>
</body>
</html>
opacity: 0.5;/背景透明度/