1. 程式人生 > >DIV+CSS實現中間彈窗效果

DIV+CSS實現中間彈窗效果

css程式碼

<style type="text/css" >
body{
     font-family: "Microsoft YaHei" ! important;
}
/*灰色遮罩層*/
.fade{
    width:100%;
    height:100%;
    background:rgba(0, 0, 0, 0.5);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99;
}
/*彈出層*/ 
.succ-pop{
    width: 400px;
    height: 300px;
    background: #fff;
    position: fixed;
    left: 50%;
    top: 50%;
    margin-left: -200px;
    margin-top: -150px;
    z-index: 999;
    border-radius: 5px;
}   
.succ-pop h3.title{
    text-align: center;
    font-size: 22px;
    color: #ce002c;
}
</style>

html程式碼
<div class="fade"></div>
<div class="succ-pop">
    <h3 class="title">
        中間填寫內容
    </h3>
</div>