参考:https://www.cnblogs.com/wangshengli520/p/7615501.html
.list1 {
width: 27%;
padding-top: 0.5rem;
list-style: none;
overflow: hidden;
display: flex;
flex-direction: column;
max-height: 6rem;
}
.list1 .listbox {
width: 100%;
position: relative;
padding-left: 0.2rem;
left: 1.35rem;
right: auto;
}
本来是这样写的应用了flex-direction:column;,但是发现他一直靠左对齐,然后边框显示不全
搜了很多解决不了 然后看了上面的链接
内外都用了display:flex;justify-content:center;
虽然好像里面写就可以了
自己试了试调整了布局就还好了
.list1 {
width: 27%;
padding-top: 0.5rem;
list-style: none;
overflow: hidden;
display: flex;
flex-direction: column;
max-height: 6rem;
}
.list1 .listbox {
width: 70%;//
position: relative;
left: 1rem;//
right: auto;
display: flex;//
justify-content:center;//
}