让一个元素水平垂直居中

设置该元素的定位方式为absolute,同时将上下左右的位置大小都设置为0,margin设置为auto,如下图所示:
posted @ 2020-05-26 10:14  雨停了,风来了  阅读(138)  评论(0编辑  收藏  举报