<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<style>
*{
margin: 0;
padding: 0
}
#main{
display: flex;
width: 400px;
height: 400px;
justify-content: center;
align-items: center;
border: 1px solid #ccc
}
#main div{
width: 100px;
height: 100px;
background-color: red;
}
</style>
</head>
<body>
<div id="main">
<div></div>
</div>
</body>
</html>