绝对定位让元素居中

<div style="position:absolute:top:50%;margin-top:-(元素高度)/2;left:50%;margin-left:-(元素宽度)/2;">
(其中负值时为了抵消元素自身的高度和宽度)
慢但努力着
原文地址:https://www.cnblogs.com/wangrongxiang/p/5177732.html