方法一(推荐):
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- margin: auto;
方法二:
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
方法三:
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top:-xxpx;
- margin-left:-xxpx;