当前位置:Gxlcms > css > css实现图片横向排列滚动效果

css实现图片横向排列滚动效果

时间:2021-07-01 10:21:17 帮助过:16人阅读

本文主要主要介绍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;

相关推荐:

javascript实现异步图片上传方法实例

CSS3图片混合怎么使用

如何用CSS做图片旋转效果

以上就是css实现图片横向排列滚动效果的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行