CSS3實現簡單的幻燈片


<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>css3 幻燈片</title>
<style type="text/css">
.ani {
width: 480px;
height: 320px;
margin: 50px auto;
overflow: hidden;
box-shadow: 0 0 5px rgba(0, 0, 0, 1);
background-size: cover;
background-position: center;
-webkit-animation-name: "loops";
-webkit-animation-duration:20s;
-webkit-animation-iteration-count: infinite;
}

@-webkit-keyframes "loops" {
0% {
background: url('img/1.jpg') no-repeat;
}
25% {
background: url('img/2.jpg') no-repeat;
}
50% {
background: url('img/3.jpg') no-repeat;
}
75% {
background: url('img/4.jpg') no-repeat;
}
100% {
background: url('img/5.jpg') no-repeat;
}
}
</style>
</head>

<body>
<div class="ani">
</div>
</body>

</html>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM