css3 white-space: nowrap 实现横向滚动

css3 white-space: nowrap 实现横向滚动

 

<div style="width: 600px; height: 100px;white-space: nowrap; overflow: auto;font-size: 0;">
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
</div>
 

 ps:里面不要用float:left不然没用了

posted @ 2020-04-14 21:22  newmiracle宇宙  阅读(488)  评论(0编辑  收藏  举报