.box {/* 大盒子 */
400px;
height: 400px;
background: #Ccc;
position: relative;
}
.box1 {/* 小盒子 */
100px;
height: 100px;
background: red;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}