让div居中对齐
使用margin-left:auto;margin-right:auto; 可以让你的div居中对齐。
.style{margin-left:auto;margin-right:auto;}
缩写形式为:
.style{margin:0 auto;}
数字0 表示上下边距是0。可以按照需要设置成不同的值。
div居中的完美解决方案! (水平垂直居中)
1,关于居中使用css为:position:fixed;left:50%;top:50%;margin-left:width/2;margin-top:height/2;
对于ie6,只能把position:改成absolute;
相关搜索
div垂直居中的方法 div盒子垂直居中 水平垂直居中css
css实现垂直水平居中 div水平居中 div里面的内容居中
div垂直水平居中 div居中显示 div内容居中
div文字垂直居中 cssdiv水平垂直居中 让div在浏览器水平垂直居中
div垂直居中的方法 div元素垂直居中 垂直居中怎么设置css
css水平居中和垂直居中 div内容水平居中 div中图片垂直居中