css实现垂直水平居中的几种方法

1.单行文本 2.多行文本web 给父元素设置display:table;子元素设置为display:table-cell; 使用position:absolute与transform配合实现 使用flex布局 3.块级元素 设置父元素为相对定位,给子元素设置绝对定位,top: 0; right: 0; bottom: 0; left: 0; margin: auto; 设置父元素为相对定位,给子
相关文章
相关标签/搜索