Mainly used in the CSS3 animation @keyframes, animation.
The layout is the outer one div width fixed, then overflow hidden absolute positioning, inside the UL fixed positioning. The effect is achieved by adding animations to the UL. The specific code is as follows
1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Document</title>6 </Head>7 <styletype= "Text/css">8 *{margin:0;padding:0;}9 ul Li{List-style:None;}Ten . Banner{width:100%;Height:568px;Overflow:Hidden;position:relative;} One . Banner ul{ A width:500%; - position:Absolute; - Left:0; the Top:0; - Height:568px; - -webkit-animation:Slide 10s linear infinite; - } + . Banner ul Li{ - float: Left; + width:20%; A Height:568px; at } - . Banner ul li:nth-child (1){background:URL (img/1.jpg) center; } - . Banner ul li:nth-child (2){background:URL (img/2.jpg) center; } - . Banner ul li:nth-child (3){background:URL (img/3.jpg) center; } - . Banner ul Li:nth-child (4){background:URL (img/4.jpg) center; } - . Banner ul Li:nth-child (5){background:URL (img/5.jpg) center; } in @-webkit-keyframes Slide{ - 0%{left:0;} to 20%{ Left:0;} + 21%{ Left:-100%;} - 40%{ Left:-100%;} the 41%{ Left:-200%;} * 60%{ Left:-200%;} $ 61%{ Left:-300%;}Panax Notoginseng 80%{ Left:-300%;} - 81%{ Left:-400%;} the 100%{ Left:-400%;} + } A . Banner:hover ul{-webkit-animation-play-state:paused;} the </style> + <Body> - <Divclass= "banner"> $ <ul> $ <Li></Li> - <Li></Li> - <Li></Li> the <Li></Li> - <Li></Li>Wuyi </ul> the </Div> - </Body> Wu </HTML>View Code
Pure CSS3 Code Write seamless scrolling effect