把一个块元素的布局设置为相对父元素 上下左右居中。记住以下祖传代码 position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);