淘宝轮播图

在这里插入图片描述

<!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;
            list-style-type: none;
        }


        .tb-promo {
            position: relative;
            width: 520px;
            height: 280px;
            background-color: pink;
            margin: 100px auto
        }

        .tb-promo img {
            width: 520px;
            height: 280px;
        }

        /* 并集选择器 */
        .prev a,
        .next a {
            /* 实现绝对定位需要父盒子相对定位 */
            position: absolute;
            top: 50%;
            margin-top: -15px;
            width: 20px;
            height: 30px;
            color: white;
            /* 实现文本水平居中,需要是标准流 */
            text-align: center;
            /* 设置背景颜色 */
            background: rgba(0, 0, 0, 0.3);
            /* 去除a标签下自带的下划线 */
            text-decoration: none;
        }

        /* 左侧按钮 */
        .prev a {
            left: 0;
            /* 实现将指定的角进行圆角处理 */
            border-top-right-radius: 15px;
            border-bottom-right-radius: 15px;
        }

        /* 右侧按钮 */
        .next a {
            right: 0;
            border-top-left-radius: 15px;
            border-bottom-left-radius: 15px;
        }

        /* 实现轮播图的焦点图 */
        .promo-nav {
            position: absolute;
            /* 设置与底部的距离 */
            bottom: 15px;
            /* 设置居中定位 */
            left: 50%;
            margin-left: -35px;
            /* background-color: pink; */
            width: 70px;
            height: 13px;
            /* 设置背景颜色 */
            background: rgba(255, 255, 255, .3);
            /* 设置圆角 */
            border-radius: 7px;
        }

        /* 实现小圆点 */
        .promo-nav li {
            float: left;
            width: 8px;
            height: 8px;
            background-color: #fff;
            border-radius: 50%;
            margin: 3px;
        }

        .promo-nav li.class1 {
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="tb-promo">
        <img src="https://img.alicdn.com/imgextra/i2/6000000008044/O1CN01WNa4ET29ICaDtz9io_!!6000000008044-0-octopus.jpg" 
        alt="">
        <!-- 左侧箭头 -->
        <div class="prev">
            <a href="#">&lt;</a>
        </div>
        <!-- 右侧箭头 -->
        <div class="next">
            <a href="#">&gt;</a>
        </div>
        <!-- 小圆点 -->
        <ul class="promo-nav">
            <li class="class1"></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值