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

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

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

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

原文地址:https://www.cnblogs.com/newmiracle/p/12701220.html