In partial scrolling, how to hide the right scroll bar when page scrolling

Although I don’t usually need to hide the scroll bar, but when I need to hide it, at first I wanted to limit the size of the parent box and hide the scroll bar by overflowing, but the concubine couldn’t do it, and later even I want to add a positioning float to cover the scroll bar (although it is also a way, but it is not too simple and rude), so I have the following method, please see:

However, in different browsers, the hiding method is also a bit different, remember to compare

Chrome, Safari and other browsers based on webkit (Blink) kernel

It uses the ::-webkit-scrollbar pseudo-element

.content::-webkit-scrollbar {
    display:none;
    width: 0;
    height: 0;
}

Guess you like

Origin blog.csdn.net/qq_59020839/article/details/131422328