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不然没用了
如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/