display flex 和 width: 100% 实现类似flex: 1的效果
1 <div class="wrap"> 2 <div class="box">1</div> 3 </div>
scss
1 .wrap{ 2 display: flex; 3 width: 500px; 4 height: 500px; 5 background-color: #09f; 6 position: relative; 7 .box { 8 background-color: #f90; 9 width: 100%; 10 } 11 }