_自动轮播图html代码 不用js">
赞
踩
用到知识点主要是css中animation动画效果
1.animation属性简写如下
animation: name duration timing-function delay iteration-count direction fill-mode play-state;
2.关键帧的设置@keyframes name{ }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>轮播图</title> <style> #bg { width: 720px; height: 360px; background-image: url(1.jpg); /* background-size: 100%; */ background-size: 100%; position: relative; /* 动画 自己取得名字 持续时间 稳定变化 一直循环 */ /* animation: name duration timing-function delay iteration-count direction fill-mode play-state; */ animation: imgs 6s linear infinite; } /* 轮播图动画关键帧设置 0%,30% 表示动画在此期间显示图二 */ @keyframes imgs { 0%, 30% { background-image: url(2.jpg); } 31%, 60% { background-image: url(3.jpg); } 61%, 100% { background-image: url(1.jpg); } } </style> </head> <body> <div id="bg"> </div> </body> </html>
效果如下不知道为啥不能放视频就先放个图片,下面的连接时视频效果
视频效果比较小不到1M也是免费的想看可以一下载一下
https://download.csdn.net/download/weixin_46097122/82505459
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。