久久久久久AV无码免费看大片,亚洲一区精品人人爽人人躁,国产成人片无码免费爱线观看,亚洲AV成人无码精品网站,为什么晚上搞的时候要盖被子

css設(shè)計遮蓋層

時間:2023-06-16 10:02:06 類型:HTML/CSS
字號:    

我們經(jīng)常用到頁面彈出一個圖層,并讓下面的顯示被遮蓋,這個是怎么實現(xiàn)的呢?

<body>
    <!-- 設(shè)置一個遮蓋層 -->
<div class = "cover"></div>
    我有被遮蓋了嗎? <a href="http://www.y46k9ti.cn">南昌雅騰</a>
    <div class="test">
        我愛大家
    </div>
</body>


css樣式:

 /* 遮蓋層 樣式*/
    .cover{
        width:100%;
        height: 100%;
        background: rgba(0, 0, 0, .9);
        position: absolute;
        left: 0;
        top: 0;
        z-index: 20;
        pointer-events: auto;
        /* 遮擋區(qū)域不讓穿透 */
        /* display: none; */
    }
    .test{
        width:200px;
        height: 200px;
        background: green;
        position: fixed;
        left: calc(50% - 100px);
        top: calc(50% - 100px);
        z-index: 200;
        display: block;
        color: #fff;
        padding: 10px;
        box-shadow: 0 0 5px 0 #ccc;
    }

效果如下:

2.png

<