首页 > 代码库 > CSS3最简洁的轮播图
CSS3最简洁的轮播图
<!DOCTYPE html> <html> <head> <title>CSS3最简洁的轮播图</title> <style> *{margin:0;padding:0;} .ckl{ margin:50px auto; overflow:hidden; height:300px; width:700px; position:relative; } ul{ list-style:none; height:300px; width:2800px; position:absolute; animation: myfirst 20s ease-out infinite alternate; -webkit-animation: myfirst 20s ease-out infinite alternate; /* Safari 与 Chrome */ } ul img{ width:700px; height:300px; } .ckl ul li{ float:left; height:300px; width:700px; } @keyframes myfirst { 0%,25% { left: 0px; } 30%,50% { left: -700px; } 55%,75% { left: -1400px; } 80%,100% { left: -2100px; } } </style> </head> <body> <div class="ckl"> <ul> <li><img src="https://cdn.pixabay.com/photo/2016/11/13/12/52/kuala-lumpur-1820944_960_720.jpg"></li> <li><img src="https://cdn.pixabay.com/photo/2014/07/21/18/31/kuala-lumpur-398792_960_720.jpg"></li> <li><img src="https://cdn.pixabay.com/photo/2015/08/28/08/06/malaysia-911580_960_720.jpg"></li> <li><img src="https://cdn.pixabay.com/photo/2012/02/28/00/39/sunset-17665_960_720.jpg"></li> </ul> </div> </body> </html>
CSS3最简洁的轮播图
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。