一个弹出层,相对浏览器居中,可以随浏览器缩放大小,有最大值和最小值(当然不支持ie6)

下边是代码

.div1{ position: fixed; z-index: 9999; background: #ccc; width: 100%; height: 100%; left: 0; top: 0}

.div2{ position: absolute; min-width: 320px; max-width: 650px; height: 500px; width: 50%; margin: auto; left: 0; right: 0; top: 0; bottom: 0;  background: #444}



<div class="div1">

    <div class="div2">aa</div>

<div>

 

你可能感兴趣的:(浏览器)