Several lines of code can easily solve the scroll bar style problem, which can be called an artifact and several lines of scroll bars.
I believe many colleagues have been confused about the scroll bar styles of various browsers, and the default scroll bar styles of different browsers are inconsistent. There are also many sayings on the Internet to modify the scroll bar style, but most of them are full of abuse. Today, I only talk about dry goods, pure dry goods, and dry goods are recommended by one of my colleagues. Here, I would like to thank my colleagues and thank you.
Step 1: Insert the following code in the style <style> </style> label:
1/* set the scroll bar style */2 3:-webkit-scrollbar {4 width: 5px; 5 height: 5px; 6} 7 8/* scroll slot */9 10:-webkit-scrollbar-track {11-webkit-box-shadow: inset 0 0 6px rgba (0, 0, 0, 0.3); 12 border-radius: 5px; 13} 14 15/* scroll bar slider */16 17:-webkit-scrollbar-thumb {18 border-radius: 10px; 19 background: rgba (0, 0, 0, 0.1); 20-webkit-box-shadow: inset 0 6px rgba (0, 0, 0, 0.5); 21}
View Code
Step 2: Add a style to the container
Overflow: auto; (or overflow-y: auto; or overflow-x: auto ;)
The effect will not be posted, let you witness the miracle moment in person! No effect. Please drop bricks ~