父盒子设置position: relative;子盒子设置了position: fixed;就是居中不了
解决方法:
给子盒子设置
display: flex;
justify-content: center;top: 0;
left: 0;
和再子级盒子设置宽度,不要设置100%设置90-95%比较好
父盒子设置position: relative;子盒子设置了position: fixed;就是居中不了
解决方法:
给子盒子设置
display: flex;
justify-content: center;top: 0;
left: 0;
和再子级盒子设置宽度,不要设置100%设置90-95%比较好