.element { width: 600px; height: 400px; position: absolute;
left: 50%;
top: 50%; transform: translate(-50%, -50%); /* 50%为自身尺寸的一半 */ }
absolute居中
猜你喜欢
转载自www.cnblogs.com/tufei7/p/11571499.html
今日推荐
周排行