Example code for css3 to achieve scroll bar beautification effect

Example code for css3 to achieve scroll bar beautification effect

The specific code is as follows:

/*Scroll bar width*/

    ::-webkit-scrollbar {
        width:9px;
        height:9px;
    }

/* Outer track. You can use display:none to hide it, or add a background image to change the color of the display*/

    ::-webkit-scrollbar-track {
        width: 6px;
        background-color:#0d1b20;
        -webkit-border-radius: 2em;
        -moz-border-radius: 2em;
        border-radius:2em;
    }

/*Scroll bar settings*/

    ::-webkit-scrollbar-thumb {
        background-color:#606d71;
        background-clip:padding-box;
        min-height:28px;
        -webkit-border-radius: 2em;
        -moz-border-radius: 2em;
        border-radius:2em;
    }
/*Background where the scroll bar moves to*/

    ::-webkit-scrollbar-thumb:hover {
         background-color:#fff;
    }

CSS

::-webkit-scrollbar { }
::-webkit-scrollbar-button { }
::-webkit-scrollbar-track { }
::-webkit-scrollbar-track-piece { }
::-webkit-scrollbar-thumb { }
::-webkit-scrollbar-corner { }
::-webkit-resizer { }

The area relationship governed by the above CSS code is:

::-webkit-scrollbar The entire scrollbar, its attributes include width, height, background, border (just like a block-level element), etc.
::-webkit-scrollbar-button Buttons at both ends of the scroll bar. You can use display:none to hide it, or add a background image or color to change the display effect.
::-webkit-scrollbar-track Outer track. You can use display:none to hide it, or add a background image or color to change the display effect.
::-webkit-scrollbar-track-piece Inner track, the middle part of the scrollbar (removed).
::-webkit-scrollbar-thumb The draggable part of the scrollbar
::-webkit-scrollbar-corner corner
::-webkit-resizer defines the style of the drag block in the lower right corner

This is the end of this article about the example code of using CSS3 to achieve scroll bar beautification effect. For more relevant CSS3 scroll bar beautification content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  Implementation code of html floating prompt box function

>>:  Example of using Nginx to implement port forwarding TCP proxy

Recommend

A brief analysis of how to use border and display attributes in CSS

Introduction to border properties border property...

Working principle and implementation method of Vue instruction

Introduction to Vue The current era of big front-...

MySQL database table and database partitioning strategy

First, let's talk about why we need to divide...

Example explanation of alarm function in Linux

Introduction to Linux alarm function Above code: ...

Docker installation and deployment of Net Core implementation process analysis

1. Docker installation and settings #Install Cent...

VMware, nmap, burpsuite installation tutorial

Table of contents VMware BurpSuite 1. Virtual mac...

Thinking about grid design of web pages

<br />Original address: http://andymao.com/a...

Implementation of effective user groups and initial user groups in Linux

First check the /etc/group file: [root@localhost ...

...

MySQL startup error InnoDB: Unable to lock/ibdata1 error

An error message appears when MySQL is started in...

Docker installs redis 5.0.7 and mounts external configuration and data issues

Redis is an open source NoSQL database written in...

Echarts tutorial on how to implement tree charts

Treemaps are mainly used to visualize tree-like d...

Docker solution for logging in without root privileges

When you use the docker command for the first tim...

CSS Naming: BEM, scoped CSS, CSS modules and CSS-in-JS explained

The scope of css is global. As the project gets b...

jQuery achieves seamless scrolling of tables

This article example shares the specific code of ...