html+css实现淘宝焦点图

实现效果:
在这里插入图片描述

代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0px;
            margin: 0px;
            box-sizing: border-box;
        }
        li{
            list-style: none;
        }

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

        .tb-promo img {
            width: 100%;
        }


        .prev,
        .next {
            display: none;
            position: absolute;
            top: 50%;
            margin-top: -15px;
            width: 20px;
            height: 30px;
            background: rgba(100, 100, 100, 0.5);
            color: white;
            line-height: 30px;
        }

        .prev {
            left: 0;
            border-radius: 0px 30px 30px 0;
        }

        .next {
            right: 0;
            border-radius: 30px 0 0 30px;
            text-indent: 0.5em;
        }

        .tb-promo:hover .prev{
            display: block;
        }
        .tb-promo:hover .next{
            display: block;
        }
        .bottom{
            position: absolute;
            bottom: 10px;
            left: 50%;
            margin-left: -40px;
            width: 80px;
            height: 20px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 10px;
        }
        .bottom li{
            float: left;
            width: 10px;
            height: 10px;
            background-color: white;
            border-radius: 10px;
            margin-left: 5px;
            margin-top: 5px;
        }
        .bottom li:nth-child(1){
            background-color: #FF5000;
        }
    </style>
</head>

<body>
    <div class="tb-promo">
        <img src="https://gtms01.alicdn.com/tps/i1/TB1r4h8JXXXXXXoXXXXvKyzTVXX-520-280.jpg" alt="">
        <div class="prev">&lt;</div>
        <div class="next">&gt;</div>
        <div class="bottom">
            <ul>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
    </div>
</body>

</html>
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值