<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>css3制作轮播</title>
<style>
.box {
width: 400px;
height: 200px;
overflow: hidden;
margin: 0 auto;
}
.content {
width: 600px;
height: 100%;
text-align: center;
display: flex;
animation: move 2s linear infinite;
}
.content:hover {
animation-play-state: paused;
}
@keyframes move {
0% {
margin-left: 0;
}
100% {
margin-left: -200px;
}
}
.item {
float: left;
width: 200px;
height: 200px;
color: #000;
font-weight: 700;
}
.item1 {
background-color: red;
}
.item2 {
background-color: green;
}
.item3 {
background-color: yellow;
}
.item4 {
background-color: blue;
}
.item5 {
background-color: purple;
}
.item6 {
background-color: pink;
}
</style>
</head>
<body>
<div class="box">
<div class="content">
<div class="item item1">1</div>
<div class="item item2">2</div>
<div class="item item3">3</div>
<div class="item item4">4</div>
<div class="item item5">5</div>
<div class="item item6">6</div>
</div>
</div>
</body>
</html>
11-29
2621
06-09
337
07-06
4842
06-18