.outer {
width: 200px;
height: 200px;
background: red;
position: relative;
}

.inner {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
}

posted on 2019-12-24 17:13  王洪洪  阅读(768)  评论(0编辑  收藏  举报