元素水平垂直居中
元素自身定位
div { width: 100px; height: 100px; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; }
或div { width: 100px; height: 100px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
父级使用flex
.parent { display: flex; justify-content: center; align-items: center; }

浙公网安备 33010602011771号