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

Detailed steps to install Mysql5.7.19 using yum on Centos7

There is no mysql by default in the yum source of...

A few experiences in self-cultivation of artists

As the company's influence grows and its prod...

How to fix the footer at the bottom of the page (multiple methods)

As a front-end Web engineer, you must have encoun...

Complete steps for using Echarts and sub-packaging in WeChat Mini Program

Preface Although the holiday is over, it shows up...

Detailed explanation of the role of static variables in MySQL

Detailed explanation of the role of static variab...

Three methods of inheritance in JavaScript

inherit 1. What is inheritance Inheritance: First...

Detailed examples of how to use the box-shadow property in CSS3

There are many attributes in CSS. Some attributes...

JavaScript implements circular progress bar effect

This article example shares the specific code of ...

Detailed explanation of Vue's custom event content distribution

1. This is a bit complicated to understand, I hop...

About the overlap of margin value and vertical margin in CSS

Margin of parallel boxes (overlap of double margi...

Basic reference types of JavaScript advanced programming

Table of contents 1. Date 2. RegExp 3. Original p...

Detailed process of configuring Https certificate under Nginx

1. The difference between Http and Https HTTP: It...

Three examples of nodejs methods to obtain form data

Preface Nodejs is a server-side language. During ...

Solution to overflow:hidden failure in CSS

Cause of failure Today, when I was writing a caro...