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不然没用了
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/18873.html