如何让绝对定位的div居中

2025-04-16 06:27:30
推荐回答(1个)
回答1:

水平居中 left:50%; margin-left:-div宽度的50% 垂直居中 top:50%; margin-top:-div高度的50% (高度不定的话就不了解了)