flex-wrap:运用到父元素上 结合 display: flex;
flex-wrap: wrap; 换行
flex-wrap: nowrap; 不换行


    
#main {
    width: 300px;
    height: 300px;
    border: 1px solid #c3c3c3;
    display: flex; 
    flex-wrap: nowrap; 默认不换行
}

#main div {
  width: 100px;
}
</style>

<div >
  <div style="background-color:coral;">11</div>
  <div style="background-color:lightblue;">22</div>
  <div style="background-color:pink;">33</div>
  <div style="background-color:olive;">4</div>
</div>

 

相关文章:

  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2021-06-08
  • 2022-02-21
  • 2021-05-22
  • 2021-11-18
相关资源
相似解决方案