css div垂直居中
2016-01-23 09:06
471 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> html,body{margin:0;padding: 0;width: 100%;height:100%;} .a{width:0;height:0;position:fixed;left:50%;rigth:50%;top:50%;bottom:50%;} .aa{ height: 400px; width: 500px; border: 1px solid red; margin-left:-250px; margin-top:-200px } </style> </head> <body> <div class="a"> <div class="aa"></div> </div> </body> </html>
原文:http://jingyan.baidu.com/article/d8072ac443b066ec95cefdd7.html