div 居中嵌套
將一個(gè) DIV 嵌套進(jìn)另一個(gè) DIV 容器,并保持水平居中、垂直居中,可使用以下代碼:
<html> <head><title>div居中嵌套</title><style type="text/css">.big{width: 800px;height: 500px;background: #333;position: relative;}.small{width: 400px;height: 200px;position: absolute;left: 50%;top: 50%;margin-left:-200px; margin-top: -100px;background: #fff;}</style> </head> <body> <div class="big"><div class="small">div居中嵌套</div> </div> </body> </html>?
轉(zhuǎn)載于:https://www.cnblogs.com/easysky/p/3546171.html
總結(jié)
- 上一篇: 禅道 非内置mysql_禅道
- 下一篇: 原型继承+原型链 + 对象继承发展