Home > Web Front-end > CSS Tutorial > css to achieve horizontal arrangement and scrolling effect of images

css to achieve horizontal arrangement and scrolling effect of images

小云云
Release: 2017-12-09 10:15:34
Original
6471 people have browsed it

This article mainly introduces CSS to achieve the horizontal arrangement and scrolling effect of images. Friends who need it can refer to it. I hope it can help everyone.

The specific code is as follows:

.imageList{
        overflow-x: auto;
        overflow-y: hidden;
        height:180px;
        white-space: nowrap;
      img{
        width:auto;
        height:100%;
        margin-right:10px;
      }
 }
Copy after login

<p class="imageList">
    <img src="1.jpg"/>
    <img src="2.jpg"/>
    <img src="3.jpg"/>
    <img src="4.jpg"/>
    <img src="1.jpg"/>
</p>
Copy after login

Note here that the img tag cannot float left, and the outer container must be added without line breaks

white-space: nowrap;
Copy after login

Related recommendations:

javascript implementation of asynchronous image upload method example

How to use CSS3 image mixing

How to use CSS to create image rotation effects

The above is the detailed content of css to achieve horizontal arrangement and scrolling effect of images. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template