Image scrolling effect made with CSS3

Image scrolling effect made with CSS3

Achieve results

Implementation Code

html

<base href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/">
<div id="slider">
<figure>
<img src="austin-fireworks.jpg" alt>
<img src="taj-mahal_copy.jpg" alt>
<img src="ibiza.jpg" alt>
<img src="ankor-wat.jpg" alt>
<img src="austin-fireworks.jpg" alt>
</figure>
</div>

CSS3

@keyframes slidy {
0% { left: 0%; }
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}

body { margin: 0; } 
div#slider { overflow: hidden; }
div#slider figure img { width: 20%; float: left; }
div#slider figure { 
  position: relative;
  width: 500%;
  margin: 0;
  left: 0;
  text-align: left;
  font-size: 0;
  animation: 5s slidy infinite; 
}

other

If you have requirements for switching speed, just modify the last time of CSS3

The above is the details of the image scrolling effect created by CSS3. For more information about CSS3 image scrolling, please pay attention to other related articles on 123WORDPRESS.COM!

<<:  mysql+mybatis implements stored procedure + transaction + multi-concurrent serial number acquisition

>>:  Detailed examples of using JavaScript event delegation (proxy)

Recommend

5 tips for writing CSS to make your style more standardized

1. Arrange CSS in alphabetical order Not in alphab...

Detailed explanation of count(), group by, order by in MySQL

I recently encountered a problem when doing IM, a...

Vue uses v-model to encapsulate the entire process of el-pagination components

Use v-model to bind the paging information object...

Native JS to achieve cool paging effect

This article uses an example to share with you a ...

On good design

<br />For every ten thousand people who answ...

Introduction to /etc/my.cnf parameters in MySQL 5.7

Below are some common parameters of /etc/my.cnf o...

Test and solution for MySQL's large memory usage and high CPU usage

After the changes: innodb_buffer_pool_size=576M -...

Implementation of Docker deployment of Tomcat and Web applications

1. Download docker online yum install -y epel-rel...

Detailed explanation of using pt-heartbeat to monitor MySQL replication delay

pt-heartbeat When the database is replicated betw...

Practical record of handling MySQL automatic shutdown problems

I recently helped someone with a project and the ...

About using Alibaba's iconfont vector icon in Vue

There are many import methods on the Internet, an...

Using keras to judge SQL injection attacks (example explanation)

This article uses the deep learning framework ker...

JavaScript to achieve the effect of clicking on the self-made menu

This article shares the specific code of JavaScri...