How to solve scrollbar style issues

一个新手
Release: 2018-05-15 14:35:09
Original
2513 people have browsed it

I believe many colleagues have been confused by the scroll bar styles of various browsers, and the default scroll bar styles of different browsers are not consistent. There are many opinions on the Internet about modifying the scroll bar style, but most of them are superficial. Today I will only talk about practical information, pure practical information. The practical information comes from the recommendation of one of my colleagues. Here, I would like to thank my colleague, thank you.

Step one: You need to insert the following code in the styletag

/* 设置滚动条的样式 */ ::-webkit-scrollbar { width: 5px; height: 5px; } /* 滚动槽 */ ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); border-radius: 5px; } /* 滚动条滑块 */ ::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5); }
Copy after login

Step two: Add styles to the container

overflow :auto; (or overflow-y:auto; or overflow-x:auto;)

The effect will not be posted, so you can witness the miraculous moment in person! If it doesn’t work, feel free to drop a brick~

The above is the detailed content of How to solve scrollbar style issues. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn