出现的问题:弹性盒和固定定位在一起使用时,发现弹性盒不起作用了。
解决办法:在标签外面再套一个盒子,在外部盒子footer上用定位,在ul身上用弹性盒,就解决啦
看代码:
<style lang="scss" scoped>
footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
ul {
list-style: none;
display: flex;
li {
flex: 1;
text-align: center;
height: 49px;
line-height: 49px;
background-color: skyblue;
border: 1px solid greenyellow;
}
}
}
</style>
效果: