<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>box上下左右居中</title>
<style>
html,body {padding: 0;margin: 0}
.bigBox {
position: absolute;
left: 0;
top:0;
right: 0;
bottom: 0;
display: flex;
justify-content:center;
align-items: center;
}
.bigBox .box {
width: 400px;
height: 150px;
border-radius: 10px;
background: silver;
}
</style>
</head>
<body>
<div class="bigBox">
<div class="box"></div>
</div>
</body>
</html>