並列的多個元素,讓其中一個元素撐滿剩餘空間

思路:使用flex佈局,父盒子設置display: flex; 須要自適應的盒子設置flex: 1。web <style> .box1{ width: 100%; display: flex; } .box4{ flex:1; } </style> <div class="box1"> <div class="box2">文本1</div> <div class="box3">
相關文章
相關標籤/搜索