display: flex;移除换行
时间: 2023-08-27 22:17:07 浏览: 114
要移除flex布局的换行,只需要将flex-wrap属性设置为nowrap即可。例如:
```
ul {
width: 100%;
display: flex;
flex-wrap: nowrap;
justify-content: flex-end;
}
```
这样就可以移除换行,使元素在一行内排列。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [css实现文本超出...和display:flex布局强制换行](https://blog.csdn.net/weixin_44255044/article/details/116149452)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [css弹性布局(display:flex)](https://blog.csdn.net/wll_web/article/details/103628388)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文