11-CSS3的animation简易轮播图

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图片轮换</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.app{
width: 710px;
height: 300px;
margin-top: 100px;
margin-left: 250px;
overflow: hidden;
}
.box{
width: 4000px;
position: relative;
animation: boxes 10s ease infinite normal;
}
@keyframes boxes{
0%{
left: 0;
}
25%{
left: -710px;
}
50%{
left: -1470px;
}
75%{
left: -2190px;
}

100%{
left: -2900px;
}
}
</style>
</head>
<body>
<div class="app">
<div class="box">
<img src="images/1.jpg">
<img src="images/2.jpg">
<img src="images/3.jpg">
<img src="images/4.jpg">
<img src="images/3.jpg">
</div>
</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/Romantic-Blood/p/11087072.html