计算机网络/计算机科学与应用/系统/运维/开发

css 弹框居中


弹框居中:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>预约提示</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style>
.shadow-box {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.3);
}
.shadow-bg {
    width: 618px;
    height: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -309px;
    margin-right: -200px;
    background: url(images/pic.png) no-repeat center;
}
</style>
</head>
<body>
    <div class="shadow-box">
        <div class="shadow-bg">
        </div>
    </div>
</body>
</html>


努力的意义,不在于一定会让你取得多大的成就,只是让你在平凡的日子里,活得比原来的那个自己更好一点。

评论

^