将div放在屏幕中间

position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);

  

原文地址:https://www.cnblogs.com/brillant/p/15662377.html