大段文字水平垂直居中
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Demo</title>
<style>
#layout {
background:#ccc;
padding: 40px 0;
text-align:center;
}
</style>
</head>
<body>
<div id = "layout">
<div id = "content">
<h1>这是标题</h1>
<p>这是内容,这段文字在当前区块内垂直水平居中</p>
</div>
</div>
</body>
</html>