HTML+CSS练习轮播图静态布局

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
    <link rel="stylesheet" href="./iconfont/iconfont.css">
</head>
<style>
    * {
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
    }
    li{
    list-style: none; 
    }
    .banner{
        width: 564px;
        height: 315px;
        margin: 100px auto;
        overflow: hidden;
        position: relative;
        
    }
    .banner img{
        width: 564px;
        border-radius: 12px;
        vertical-align: middle;
    }
    .banner ul{
        display: flex
    }
    .banner .left{
        width: 20px;
        height: 30px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 0 15px 15px 0;
        text-decoration: none;
        color: #fff;
        line-height: 30px;
        display: none;
        cursor: pointer;
    }
    .banner .right{
        width: 20px;
        height: 30px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 0;
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 15px 0 0 15px;
        text-decoration: none;
        color: #fff;
        line-height: 30px;
        text-align: center;
        display: none;
        cursor: pointer;
    }
    .banner:hover .left,
    .banner:hover .right{
        display: block;
    }

    .banner ol{
        position: absolute;
        background-color: rgba(255, 255, 255, 0.3);
        height: 13px;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        border-radius: 10px;
    }
    .banner ol li{
        margin: 3px;
        width: 8px;
        height: 8px;
        background-color: #fff;
        border-radius: 50%;
        cursor: pointer;
    }
</style>
<body>
    <div class="banner">
        <ul>
            <li><a href=""><img src="./1.png" alt=""></a></li>
            <li><a href=""><img src="./2.png" alt=""></a></li>
            <li><a href=""><img src="./3.png" alt=""></a></li>
        </ul>
        <div class="left">
            <span class="iconfont icon-arrow-left-bold"></span>
        </div>
        <div class="right">
            <span class="iconfont icon-arrow-right-bold"></span>
        </div>
        <ol>
            <li></li>
            <li></li>
            <li></li>
        </ol>
    </div>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值