html学习技巧

2019-03-26  本文已影响0人  晴天的枫

html技巧
通过将div设置成fixed,可以模拟弹窗。

<html>
    <head>
            <script>
                    .dialog-backdrop {
                            background: rgba(0, 0, 0, 0.2);
                            position: fixed;
                            top: 0;
                            left: 0;
                            right: 0;
                            bottom: 0;
                        }
                </script>
    </head>
<body>
        <div className="dialog-backdrop">
                <div className="dialog-container">
                    <div className="dialog-header">提示</div>
                    <div className="dialog-body">{message}</div>
                    <div className="dialog-footer"> 
                        <button className="btn" onClick={close}>确定</button>
                    </div>
                </div>
            </div>
</body>

</html>
上一篇 下一篇

猜你喜欢

热点阅读