HTML实现遮罩层的方法 HTML中如何使用遮罩层

2020-04-16 21:44:51易采站长站整理

    <div id=’modalContent’ style=’display: none;’>  
        <div class=’modal-container’ style=’width: 100%;height: 100%;background-color: white;’>  
            <div style=’width: 100%;height: 49px;position: relative;left: 50%;top: 50%;’>  
                <span style=’font-size: 36px; width: 100%; text-align:center; display: inline-block; position:inherit; left: -50%;top: -50%;’>模态窗口1</span>  
            </div>  
            <button class=’btn-close’ style=’width: 100px; height: 30px; position: absolute; right: 30px; bottom: 20px;’>关闭</button>  
        </div>  
    </div>  
    <script type=’text/javascript’ src="js/jquery-1.10.2.js"></script>  
</body>  
</html>  
  

运行结果:

初始化

显示遮罩层和Loading提示

显示遮罩层和模拟弹出模态窗口

原文:http://www.cnblogs.com/haoqipeng/p/html-overlay.html