<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
#father {
width: 500px;
height: 500px;
background: lightcoral;
margin: 100px auto;
display: flex;
justify-content: center;
align-items: center;
}
#son{
width: 200px;
height: 200px;
background: lightskyblue;
}
</style>
</head>
<body>
<div id="wrap">
<div id="box"></div>
</div>
</body>
</html>
子div在父div水平垂直居中
最新推荐文章于 2022-08-03 17:01:58 发布