Pure HTML and CSS to achieve JD carousel effect

Pure HTML and CSS to achieve JD carousel effect

The JD carousel was implemented using pure HTML and CSS, without adding dynamic effects, and mainly using positioning knowledge.

, as shown in the figure are two side arrow pictures.

<!DOCTYPE html>
<html lang="en">
<head> <meta charset="UTF-8">
    <title>LunBo</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        li{
            list-style: none;
        }
        .lunbo{
            margin: 40px auto;
            height: 470px;
            width: 590px;
            position: relative;
        }
        .left,.right{
            position: absolute;
            top: 50%;
            margin-top: -18px;
            width: 24px;
            height: 36px;
        }
        .left{
            left: 0;
        }
        .right{
            right: 0;
        }
        .lunbo ul{
            height: 18px;
            width: 151px;
            background: rgba(255,255,255,.3);
            position: absolute;
            bottom: 10px;
            left: 50%;
            margin-left: -76px;
            border-radius: 10px;
        }
        .lunbo li{
            height: 14px;
            width: 14px;
            border-radius: 50%;
            background-color: #fff;
            float: left;
            margin: 2px;
        }
        .lunbo .current{
            background-color: #f40;
        }
    </style>
</head>
<body>
    <div class="lunbo">
        <img src="images/lunbo.jpg" alt="">
        <div class="left"><img src="images/left.png" alt=""></div>
        <!-- You can also use a link and then use background -->
        <div class="right"><img src="images/right.png" alt=""></div>
        <ul>
            <li class="current"></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>
</html>

The following effects were achieved

Summarize

The above is the pure HTML and CSS to achieve the JD carousel effect introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  The unreasonable MaxIdleConns of MySQL will cause short connections

>>:  Five practical tips for web form design

Recommend

WeChat applet learning wxs usage tutorial

What is wxs? wxs (WeiXin Script) is a scripting l...

Bug of Chinese input garbled characters in flex program Firefox

Chinese characters cannot be input in lower versio...

How to set a dotted border in html

Use CSS styles and HTML tag elements In order to ...

Detailed explanation of three methods of JS interception string

JS provides three methods for intercepting string...

What is the base tag and what does it do?

The <base> tag specifies the default addres...

Vue uses OSS to upload pictures or attachments

Use OSS to upload pictures or attachments in vue ...

How to deploy hbase using docker

Standalone hbase, let’s talk about it first. Inst...

Detailed steps to install RabbitMQ in docker

Table of contents 1. Find the mirror 2. Download ...

Analysis of Nginx Rewrite usage scenarios and configuration methods

Nginx Rewrite usage scenarios 1. URL address jump...

JavaScript uses canvas to draw coordinates and lines

This article shares the specific code of using ca...

Windows DNS server exposed "worm-level" vulnerability, has existed for 17 years

Vulnerability Introduction The SigRed vulnerabili...

Use of align-content in flex layout line break space

1. The effect diagram implemented in this article...