动画实现 keyframes
<style>
* {
padding: 0;
margin: 0;
}
body {
width: 100%;
height: 100vh;
display: grid;
place-items: center;
}
div {
width: 500px;
height: 300px;
background-color: #000;
border-radius: 20px;
box-shadow: 0 0 10px rgba(0, 0, 34, .5);
/* animation: name duration timing-function delay iteration-count direction fill-mode; */
animation: ppt 9s infinite linear;
}
@keyframes ppt {
0% {
background: url(https://tva4.sinaimg.cn/large/0072Vf1pgy1foxkiqu05cj31hc0u0duy.jpg) no-repeat;
background-size: cover;
}
50% {
background: url(https://tva1.sinaimg.cn/large/7f0c40d4gy1fqbf0e94b8j21hc0xc1ky.jpg) no-repeat;
background-size: cover;
}
100% {
background: url(https://tva1.sinaimg.cn/large/0072Vf1pgy1fodqnbricvj31kw0vk7wh.jpg) no-repeat;
background-size: cover;
}
}
</style>
<body>
<div></div>
</body>
![](https://cdn.jsdelivr.net/gh/Rr210/image@master/hexo/api/daw2131.gif#height=308&id=f9my4&margin=%5Bobject%20Object%5D&originHeight=410&originWidth=636&originalType=binary&ratio=1&status=done&style=shadow&width=477)