我给元素设置justify-content:center能居中,但是加入 position: fixed;后元素为什么就不能居中呢?难道使用fixed后flex布局就不生效吗?
.v-stairs-nav {
display: flex;
position: fixed;
justify-content: center;
}
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
position:fixed
文档脱离标准流了,你加个width:100%
可以解决此问题