.imageList{ overflow-x: auto; overflow-y: hidden; height:180px; white-space: nowrap; img{ width:auto; height:100%; margin-right:10px; } }
<div class="imageList"> <img src="1.jpg"/> <img src="2.jpg"/> <img src="3.jpg"/> <img src="4.jpg"/> <img src="1.jpg"/> </div>
这里注意,img标签不能左浮动,外层容器必须加不换行
white-space: nowrap;
。
内容来源于网络如有侵权请私信删除
- 还没有人评论,欢迎说说您的想法!