CSS DIV 上下左右 完全 全屏 居中
.center {
position: absolute; width: 800px; height: 520px; margin: auto; top: 0; left: 0; bottom: 0; right: 0; background-color: #ffffff; overflow-x: hidden; overflow-y: hidden;
}资料来源
http://blog.jobbole.com/46574/
本文介绍了一种使用CSS实现元素在页面上全屏居中的方法。通过设置position为absolute并结合margin:auto以及top、left、bottom、right属性,可以使指定大小的div元素无论在什么分辨率下都能水平垂直居中显示。
CSS DIV 上下左右 完全 全屏 居中
.center {
position: absolute; width: 800px; height: 520px; margin: auto; top: 0; left: 0; bottom: 0; right: 0; background-color: #ffffff; overflow-x: hidden; overflow-y: hidden;
}http://blog.jobbole.com/46574/
195

被折叠的 条评论
为什么被折叠?