day02(2017.9.21)

轮播图

//html
1 2 3
//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))