场景
有时候项目中使用了flex布局,高度或是宽度是自动填满剩余空间,不是具体的数值的时候,想要设置区域滚动条,可采用以下方法设置:
解决方法:
<div style="flex: 1;width: 30%;">
<div style="position: relative;height: 100%;width: 100%;">
<div style=" display: flex;flex-direction: column;height: 100%;">
<div style="flex-grow: 1;height:0">
<div style="overflow: auto;height: 100%;overflow-x: hidden;">
自定内容
</div>
</div>
</div>
</div>
</div>
效果
本文转载自: https://blog.csdn.net/weixin_72589507/article/details/127983731
版权归原作者 蜗牛慢慢爬200 所有, 如有侵权,请联系我们删除。
版权归原作者 蜗牛慢慢爬200 所有, 如有侵权,请联系我们删除。