用过bootstrap的同学应该都遇到过自带插件模态框不垂直居中的一个问题。
现在我提供一个CSS的解决方案
.modal-dialog {
position: absolute;
margin: 10px auto;
left: 0;
right: 0;
top: 50%;
}
大家可以把这句CSS添加到bootstrap.css里面,也可以单独定义一个类,大家用模态框的时候把这个类添加进去就可以了 用过bootstrap的同学应该都遇到过自带插件模态框不垂直居中的一个问题。
现在我提供一个CSS的解决方案
.modal-dialog {
position: absolute;
margin: 10px auto;
left: 0;
right: 0;
top: 50%;
}
大家可以把这句CSS添加到bootstrap.css里面,也可以单独定义一个类,大家用模态框的时候把这个类添加进去就可以了
评论 (0)