首页 > 其他分享 >前端009-opacity-z-index

前端009-opacity-z-index

时间:2022-11-19 16:01:02浏览次数:51  
标签:opacity index color text 009 200px left

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>opacity</title>
<style>
.c1{
margin:0 auto;
width: 1080px;
text-align: center;
}
.pos{
background-color: #e75e15;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 0.6;
}
</style>
</head>
<body style="margin: 0 auto;width: 1080px">
<h3>13-opacity-透明度(0完全透明->1不透明)与z-index(层级)配合使用--通过style="display: none"来决定展示与否</h3>
<h3>14-z-index-层级-数越大越在上面-如果不指定-最后面的标签在最上面</h3>
<h1 class="c1" style="height: 200px;background-color: #e75e15">第一层</h1>
<div class="pos" style="z-index: 8" ></div>
<div style="height: 200px;
width: 200px;
background-color:darkgoldenrod;
position: fixed;
margin-left:-100px;
left: 50%;
top: 200px;
text-align: center;
line-height: 200px;
z-index: 9">
第三层
</div>

</body>
</html>

标签:opacity,index,color,text,009,200px,left
From: https://www.cnblogs.com/lfyxys/p/16906284.html

相关文章