css垂直居中的方法

原文地址:https://blog.csdn.net/qq_42624874/article/details/81744134 1. 使用絕對定位和負外邊距   優點:兼容性良好  缺點:必須知道需要居中塊級的尺寸 2. 使用絕對定位和transform   優點:translate百分比相當於元素自身而言,不必知道居中區塊的尺寸 3. 絕對定位結合margin: auto   使用絕對定位後,t
相關文章
相關標籤/搜索