本文主要主要介绍css实现图片横向排列滚动效果,需要的朋友可以参考下,希望能帮助到打大家。
具体代码如下所示:
.imageList{
overflow-x: auto;
overflow-y: hidden;
height:180px;
white-space: nowrap;
img{
width:auto;
height:100%;
margin-right:10px;
}
}<p class="imageList">
<img src="1.jpg"/>
<img src="2.jpg"/>
<img src="3.jpg"/>
<img src="4.jpg"/>
<img src="1.jpg"/>
</p>
这里注意,img标签不能左浮动,外层容器必须加不换行
立即学习“前端免费学习笔记(深入)”;
white-space: nowrap;
相关推荐:
以上就是css实现图片横向排列滚动效果的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号