css-轮播图效果

<!DOCTYPE html>
<html lang="zh-EN">

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

        li {
            list-style: none;
        }

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

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

        a {
            text-decoration: none;
        }

        .pre {
            left: 0;
            border-top-right-radius: 15px;
            border-bottom-right-radius: 15px;
        }

        .pre,
        .next {
            position: absolute;
            top: 50%;
            margin-top: -15px;
            width: 20px;
            height: 30px;
            background: rgba(0, 0, 0, 0.3);
            color: #fff;
            text-align: center;
            line-height: 30px;
        }

        .next {
            right: 0;
            border-top-left-radius: 15px;
            border-bottom-left-radius: 15px;
        }

        .prom-nav {
            position: absolute;
            width: 70px;
            height: 13px;
            background: rgba(255, 255, 255, .3);
            bottom: 15px;
            left: 50%;
            margin-left: -35px;
            border-radius: 7px;

        }

        .prom-nav li {
            width: 8px;
            height: 8px;
            background-color: #fff;
            float: left;
            border-radius: 4px;
            margin: 3px;
        }

        .prom-nav .sel {
            background-color: #ff5000;
        }
    </style>
</head>

<body>
    <div class="tb-promo">
        <img src="imgs/002.gif" alt="">
        <a href="#" class="pre">&lt;</a>
        <a href="#" class="next">&gt;</a>
        <ul class="prom-nav">
            <li class="sel"></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>

</html>
posted @ 2025-09-24 09:29  紫川先生  阅读(20)  评论(0)    收藏  举报