<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> .wrap{ background: #000; width: 500px; height: 500px; color: #fff; display:table-cell; vertical-align: middle; float:right; } .verticalWrap{ position: relative; top: 50%; +top: 100%; } .vertical{ text-align: center; position: relative; top: -50%; +top: -50%; } </style> </head> <body> <div class="wrap"> <div class="verticalWrap"> <div class="vertical"> 测试测试<br/> 网页特效<br/> </div> </div> </div> </body> </html>