垂直水平居中 css

1 實現原理:         1 設置 .main 元素爲相對定位 position: relative;,這樣其子元素設置絕對定位時就相對它了。         2 而後設置 .content 元素爲絕對定位 position: absolute; 並設置它的 top、left、bottom、right 都爲0,         3 這樣該元素的元素的尺寸表現爲「格式化寬度和格式化高度」,和
相關文章
相關標籤/搜索