点击出现幻灯片效果

<style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        html,body{
            height: 100%;
        }
        .img-box{
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 0;
        }
        .img-box img{
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
        }
        .img-box img:target{
            z-index: 5;
        }
        .img-box img:nth-child(1):target{
            animation: showleft 1s;
        }
        .img-box img:nth-child(2):target{
            animation: showtop 1s;
        }
        .img-box img:nth-child(3):target{
            animation: rot 1s;
        }
        .img-box img:nth-child(1){
            z-index: 1;
        }
        ul{
            position: absolute;
            z-index: 1;
            width: 300px;
            height: 80px;
            left: 50%;
            bottom: 20px;
            margin-left: -150px;
        }
        ul li{
            float: left;
        }
        ul li a{
            display: block;
            width: 80px;
            height: 80px;
            background-color: pink;
            border-radius: 50%;
            margin-left: 20px;
            text-align: center;
            line-height: 80px;
            font-size: 30px;
            color: red;
            text-decoration: none;
        }
        @keyframes showleft{
            0%{
                transform: translateX(-2000px);
            }
            100%{
                transform: translateX(0px);
            }
        }
        @keyframes showtop{
            0%{
                transform: translateY(-1000px);
            }
            100%{
                transform: translateY(0px);
            }
        }
        @keyframes rot{
            0%{
                transform: scale(0.5) rotate(345deg);
            }
            100%{
                transform: scale(1) rotate(0deg);
            }
        }
    </style>

    <body>
    <div class="img-box">
        <img src="img/veer-133066359.jpg" id="img1" alt="">
        <img src="img/veer-133572107.jpg" id="img2" alt="">
        <img src="img/veer-136759701.jpg" id="img3" alt="">
    </div>
    <ul>
        <li><a href="#img1">1</a></li>
        <li><a href="#img2">2</a></li>
        <li><a href="#img3">3</a></li>
    </ul>
    
    </body>

                                                         本文属于学习笔记,不做其他用途

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值