解决flex布局横向显示不全
<style> .showTotal{ width: 100%; //must set overflow: auto; } .outter{ width: 98%; min-width: 60vw; height: auto; overflow: auto; display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: flex-start; margin:0 auto; padding-bottom: 30px; } .list{ background: linear-gradient(45deg,#fff7b3 30%,#fffcdd 60%, #fff 90%); border: 1px solid #98fae5; border-radius: 15px; box-shadow: 0 0 6px #98fae5; margin-top:20px; padding: 10px 15px 30px 15px; flex:1 0 80vw; margin-left: 30px; height: 70vh; } </style>
<div class="showTotal"> <div class="outter"> <div class="list"> </div> <div class="list"> </div> <div class="list"> </div> <div class="list"> </div> <div class="list"> </div> </div> </div>
需要外层套一个div 并设置固定宽度