flex平分宽度。flex宽度自适应,均分宽度 电脑版发表于:2023/2/7 23:24 html: ``` <div class="parent"> <div class="item"> 测试1 </div> <div class="item"> 测试1 </div> <div class="item"> 测试1 </div> <div class="item"> 测试1 </div> </div> ``` 样式: ``` .parent{ display: flex; flex-direction: row; width: 100%; height: 100px; align-items: center; } .item{ flex: 1; height: 20px; } ``` 原文地址:https://blog.csdn.net/u014753756/article/details/108710338