【居中】垂直居中
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <style> .wrap { width: 300px; height: 300px; border: 3px solid #ddd; display: table; *position: relative; } .hack { display: table-cell; vertical-align: middle; *position: absolute; *top: 50%; } .cnt { *position: relative; *top: -50%; } </style> <div class="wrap"> <div class="hack"> <div class="cnt">content</div> </div> </div> <div class="wrap"> <div class="hack"> <div class="cnt"> <img src="http://pic002.cnblogs.com/images/2012/382256/2012080118323766.gif" width="50%"> </div> </div> </div> </body> </html>