使用css3將一個div水平和垂直居中顯示

使用css3將一個div水平和垂直居中顯示 方案一: div絕對定位水平垂直居中【margin:auto實現絕對定位元素的居中】, 代碼兩個關鍵點:1.上下左右均0位置定位;         2.margin: auto; 其width、height如何更改都是居中顯示的,兼容性可以,IE7及之前版本不支持 1 .div1{ 2 3 width: 100px; 4 hei
相關文章
相關標籤/搜索