初学前端 写一个简易版的只有CSS和html的轮播图

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        li {
            margin: 0px;
            padding: 0px;
        }
        .box1{
            width: 480px;
            height: 360px;
            margin: 200px auto;
            position: relative;
        }
        .box1 img{
            width: 480px;
            height: 360px; 
        }
        .box1 .left-btn{
            position: absolute;
            left: 0;
            top: 50%;
            width: 0px;
            margin-top: -30px;
            border: 30px solid transparent;
            border-right-color: #3ab964;
        }
        .box1 .right-btn{
            position: absolute;
            right: 0;
            top: 50%;
            margin-top: -30px;
            border: 30px solid transparent;
            border-left-color:  #3ab964;
        }
        .box1 ul{
            list-style: none;
        }
        .box1 .center{
            width: 200px;
            height: 20px;
            position: absolute;
            /* background-color: white; */
            left: 50%;
            bottom: 20px;
            margin-left: -100px;
            /* border-radius: 30px;
            margin-right: 20px; */
        }
        .box1 .center li{
            float: left;
            background-color: white;
            width: 35px;
            height: 20px;
            margin-right: 20px;
            border-radius: 10px;
        }
        .box1 .center li:first-child{
            background-color: #3ab964;
        }
        .box1 .center li:last-child{
            margin-right: 0px;
            /* background-color: green; */
        }
        .box1 .center li a {
            display: block;
            width: 35px;
            height: 20px;
        }

    </style>
</head>
<body>
    <div class="box1">
        <img src="images/study.jpg" alt="">
        <div>
            <a href="" class="left-btn btn"></a>
            <a href="" class="right-btn btn"></a>
            <div class="center">
                <ul>
                    <li><a href="#"></a></li>
                    <li><a href="#"></a></li>
                    <li><a href="#"></a></li>
                    <li><a href="#"></a></li>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值