纯html_css实现图片轮播

 

<style>
    #frame{position:absolute;width:300px;height:200px;overflow:hidden;border-radius:5px}
    #dis{position:absolute;left:-50px;top:-10px;opacity:.5}
    #dis li{display:inline-block;width:200px;height:20px;margin:0 50px;float:left;text-align:center;color:#fff;border-radius:10px;background:#000}
    #photos img{float:left;width:300px;height:200px}
    #photos {  position: absolute;z-index:9;  width: calc(300px * 4);/*---修改图片数量的话需要修改下面的动画参数*/  }
    .play{ animation: ma 20s ease-out infinite alternate;}
    @keyframes ma {
        0%,25% {        margin-left: 0px;       }
        30%,50% {       margin-left: -300px;    }
        55%,75% {       margin-left: -600px;    }
        80%,100% {       margin-left: -900px;    }

    }
</style>
<div id="frame" >
    <div id="photos" class="play">
        <img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png" >
        <img src="https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1954556401,4253539227&fm=170&s=2A2C7D2243A3C2ED0AD0F1DC0000D0B1&w=640&h=731&img.JPEG" >
        <img src="https://ss2.baidu.com/6ONYsjip0QIZ8tyhnq/it/u=2816586851,1045936241&fm=170&s=F995099C92C07AFCE711008403007082&w=640&h=411&img.JPEG" >
        <img src="https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=2360817639,1949908322&fm=170&s=C7135B8452332FADE021B0B503001081&w=640&h=813&img.JPEG" >
        <ul id="dis">
            <li>111111111111111</li>
            <li>22222222222222</li>
            <li>33333333333333</li>
            <li>44444444444444</li>
        </ul>
    </div>
</div>

 

posted on 2017-02-25 18:13 木子炜培先生 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/liadmin/p/6442378.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值