css垂直居中的方法

原文地址:https://blog.csdn.net/qq_42624874/article/details/81744134 1. 使用绝对定位和负外边距   优点:兼容性良好  缺点:必须知道需要居中块级的尺寸 2. 使用绝对定位和transform   优点:translate百分比相当于元素自身而言,不必知道居中区块的尺寸 3. 绝对定位结合margin: auto   使用绝对定位后,t
相关文章
相关标签/搜索