<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>moyu-edu.com</title>
<style>
*{
margin: 0;
padding: 0;
}
body,html{
height: 100%;
}
body{
text-align: center;
}
span{
display: inline-block;
height: 100%;
vertical-align: middle;
}
div{
width: 400px;
border: solid 1px red;
vertical-align: middle;
display: inline-block;
*display: inline;
*zoom:1;
text-align: left;
}
</style>
</head>
<body>
<span></span><div class="box">測(cè)試文字<br>asdfasdf<br>asdafasdfsdafadsf</div>
</body>
</html>
兼容所有的瀏覽器