代码编程如何实现盒子水平垂直居中 方法一 :{position: fixed;left: 50%; top: 50%;margin-left: -盒子宽度一半;margin-top: -盒子高度的一半;}方法二: margin:auto 实现绝对定位元素的居中 弊端:兼容ie8以上浏览器{position: fixed;left: 0;right: 0;top: 0;bott……继续阅读 » 1年前 (2021-10-20) 114浏览