我有一个简单的模态的div:简单的CSS规则模式
<div class="modal"></div>
<div class="modal-content"></div>
然后theyr相关的CSS规则:
.modal{position:fixed;background:#444;opacity:0.5;width:100%;height:100%;left:0;right:0;bottom:0;top:0;}
.modal-content{position:fixed;background:#fff;width:auto;height:auto;top:25%;left:25%;right:25%;}
我想那是什么.modal内容仍然始终围绕页面上最大宽度500px;而宽度:自动;
有没有可能不使用JS?
我添加了,但它的结果不在页面上:P – sbaaaang
嗨,也尝试添加页边距:0 auto 0 auto 0;对此。现在正常工作在我身边。 –
nope ...我在FF6上.. .modal-content {position:fixed; background:#fff; margin:0 auto 0 auto 0; width:900px; right:0; left:0; height:auto ; top:25%;}它不起作用(不居中) – sbaaaang