美文网首页
day02(2017.9.21)

day02(2017.9.21)

作者: 晴_eeca | 来源:发表于2017-09-21 21:27 被阅读18次

    轮播图

    //html
    <div class="box">
        <a href="#" class="one">1</a>
        <a href="#" class="two">2</a>
        <a href="#" class="three">3</a>
        <div class="move">
            <div class="list1"></div>
            <div class="list2"></div>
            <div class="list3"></div>
        </div>
    </div>
    
    //css
    .box{
                width: 600px;
                height: 400px;
                margin: 100px auto;
                overflow: hidden;
                position: relative;
            }
            .move{
                width: 1800px;
                position: absolute;
            }
            .move>div{
                width: 600px;
                height: 400px;
                float: left;
                background-size: 600px 400px;
            }
            .list1{
                background: url("images/01.jpg") no-repeat center;
            }
            .list2{
                background:  url("images/02.jpg") no-repeat center;
            }
            .list3{
                background: url("images/03.jpg") no-repeat center;
            }
            a{
                display: inline-block;
                width: 50px;
                line-height: 50px;
                text-align: center;
                font-size: 16px;
                color: white;
                text-decoration: none;
                border: 1px solid #ccc;
                border-radius: 50%;
                margin: 10px auto;
                cursor: pointer;
            }
            .one{
                background: red;
            }
            .two{
                background: green;
            }
            .three{
                background: blue;
            }
            .one:focus +.two+.three+.move{
                left: 0;
            }
            .two:focus+.three+.move{                       
                left: -600px;
            }
            .three:focus+.move{
                left: -1200px;
            }
    
    重要程序
    .one:focus +.two+.three+.move{
                left: 0;
            }
            .two:focus+.three+.move{                       
                left: -600px;
            }
            .three:focus+.move{
                left: -1200px;
            }
    

    相关文章

      网友评论

          本文标题:day02(2017.9.21)

          本文链接:https://www.haomeiwen.com/subject/sdrzsxtx.html