Without further ado, let’s get straight to the code * { margin: 0; padding: 0; } .container { margin:300px auto; height: 400px; width: 1146px; overflow: hidden; } /* .wrap */ .wrap { position: relative; width:10000px; left: 0px; animation: animateImg ease 5s infinite normal; } /* Image size*/ .wrap img { width: 1146px; float: left; height: 400px; display: block; } /* Animation */ @keyframes animateImg { 0% { left: 0px; } 20% { left: -0px; } 40% { left: -1146px; } 60% { left: -2292px; } 80% { left: -3438px; } 100% { left: 0px; } } The animation effect pixels are modified according to the size of your own picture <div class="container"> <div class="wrap"> <img src="images/banner1.jpg"alt="" /> <img src="images/banner2.jpg"alt="" /> <img src="images/banner3.jpg"alt="" /> <img src="images/banner4.jpg"alt="" /> </div> This is the end of this article about how to use pure CSS to achieve automatic rotation of carousel banners. For more information about how to use pure CSS to achieve automatic rotation of carousel banners, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Implementation steps for Docker deployment of SpringBoot applications
>>: Detailed explanation of the use of Vue's new built-in components
The function has been implemented a long time ago...
Today, when I was installing CentOS6.2, I couldn&...
Table of contents WXS Response Event Plan A Page ...
In web page production, displaying and hiding ele...
Overlay network analysis Built-in cross-host netw...
border-radius:10px; /* All corners are rounded wi...
The following analysis is about product design pr...
Table of contents 1. Date 2. RegExp 3. Original p...
TabIndex is to press the Tab key to sequentially o...
1. Remove backslashes through the "stripslas...
1. Single machine environment construction# 1.1 D...
Method 1: Use the SET PASSWORD command mysql -u r...
The operating environment of this tutorial: Windo...
Page turning problem scenario B and C are on the ...
Table of contents Master-Master Synchronization S...