首先给div自己设置相对定位、绝对定位、固定定位spa
一、上下居中margin
top:50%;margin-top:-(自己高度*50%)top
二、左右居中di
left:50%;margin-left:-(自己宽度*50%)co