CSS设置居屏幕中间的弹出块

.alert {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 300px;
    height: 200px;
    margin-left: -150px;
    margin-top: -100px;
    background: #1c242a;
    -webkit-border-radius: 5px;
    padding-bottom: 15px;
}

这段代码解决了弹出块居中的问题,但不能根据弹出块的内容自动调整弹出快的大小

 

posted @ 2013-03-19 18:37  炘恪  阅读(345)  评论(0编辑  收藏  举报