HTML 彈出遮罩層一(遮罩層和內容標簽嵌套)


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .modal_cover{
            display: none;
            width: 100%;
            height: 100%;
            position: fixed;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, .6);
        }
        .modal{
            position: absolute;
            width: 823px;
            background: white;
          z-index: 99;
            height: 80px;
            /* 水平垂直居中 */
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
            /* 超出高度右側出現垂直滾動條 */
            overflow:auto;
            overflow-x:hidden;
        } 
        .button{ 
            margin: 40px;
        }
    </style>
</head>
<body>
    <div class="modal_cover" style="display:block">
        <div class="modal"> 
            <button class="button">提交申訴</button>  
        </div>
    </div>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM