<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鳥(niǎo)教程(runoob.com)</title>
<style>
body {
background-color:#d0e4fe;
}
.f{
width:500px;
height:500px;
display: flex;
border:1px solid red;
justify-content: center;
align-items: center;
}
.c{
width:200px;
height: 200px;
border:1px solid red;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div class="f">
<div class="c">垂直居中</div>
</div>
</body>