CSS3 changes the browser scroll bar style

CSS3 changes the browser scroll bar style

Note: This method is only applicable to webkit-based browsers.

The browser scroll bar is too wide and ugly, which affects daily development. What should I do?

The appearance of the scroll bar consists of two parts: 1. The overall slide of the scroll bar 2. The slider inside the scroll bar slide

In CSS, the scroll bar consists of 3 parts

name::-webkit-scrollbar //Overall scrollbar stylename::-webkit-scrollbar-track //Scrollbar trackname::-webkit-scrollbar-thumb //Scrollbar internal slider

Note: The above three are all pseudo-classes. Please change name to the element name you want to change.

For example: change the scroll bar style of the entire page

body::-webkit-scrollbar{ //First change the scroll bar width of body: 8px;

}

body::-webkit-scrollbar-track{//Change the scroll bar track color of the body background: rgb(200, 200, 200);

border-radius: 5px;

}

body::-webkit-scrollbar-thumb{//Finally, change the style of the body's scroll bar slide background: rgb(120, 120, 120);

border-radius: 5px;

}

◆ The right side shows the scroll bar style after the upper code is changed

◆ You can add background, transparency, border, rounded corners and other attributes to the style to make the browser more beautiful

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  Several ways to encrypt and decrypt MySQL (summary)

>>:  Tutorial on deploying springboot package in linux environment using docker

Recommend

How to implement nested if method in nginx

Nginx does not support nested if statements, nor ...

Steps and pitfalls of upgrading linux mysql5.5 to mysql5.7

Table of contents Linux MySQL 5.5 upgraded to MyS...

Detailed explanation of Nginx rewrite jump application scenarios

Application scenario 1: Domain name-based redirec...

CSS3 realizes the effect of triangle continuous enlargement

1. CSS3 triangle continues to zoom in special eff...

Tutorial on using the hyperlink tag in HTML

The various HTML documents of the website are con...

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK Step 1: First download t...

JS achieves five-star praise effect

Use JS to implement object-oriented methods to ac...

Mini Programs use Mini Program Cloud to implement WeChat payment functions

Table of contents 1. Open WeChat Pay 1.1 Affiliat...

How to use JS to implement waterfall layout of web pages

Table of contents Preface: What is waterfall layo...

Solution to MySQL master-slave delay problem

Today we will look at why master-slave delay occu...

How to limit the number of records in a table in MySQL

Table of contents 1. Trigger Solution 2. Partitio...

Writing High-Quality Code Web Front-End Development Practice Book Excerpts

(P4) Web standards are composed of a series of sta...

Example analysis of mysql variable usage [system variables, user variables]

This article uses examples to illustrate the usag...

Summary of Mysql-connector-java driver version issues

Mysql-connector-java driver version problem Since...