<!DOCTYPE html>
<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">
.vertical-container {
height: 500px;
display: -webkit-flex;
display:flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
border:solid 1px red;
}
</style> </head> <body>
<div class="vertical-container">
<div>CSS里总算是有了一种简单的垂直居中布局的方法了!</div>
</div>
</body>
</html>