Css: modifies the default style of a scroll bar.

Source: Internet
Author: User

Css: modifies the default style of a scroll bar.

Previously, due to Company project requirements, I found the following on the Internet:

Code directly

Html code

<Div class = "inner"> <div class = "innerbox"> <p style = "height: 200px; "> This is the content 111 </p> <p style =" height: 400px; "> content 222 </p> <p> content 333 </p> </div>

Css code

. Inner {width: 265px; height: 400px; position: absolute; top: 33px; left: 13px;/* cursor: pointer; */overflow: hidden ;}. innerbox {overflow-x: hidden; overflow-y: auto; color: #000; font-size :. 7rem; font-family: "\ 5FAE \ 8F6F \ 96C5 \ 9ED1", Helvetica, "", Arial, Tahoma; height: 100%;}/* scroll bar style */. innerbox:-webkit-scrollbar {/* overall scroll bar style */width: 4px;/* height and width correspond to the size of the horizontal and vertical scroll bars */height: 4px ;}. innerbox:-webkit-scrollbar-thumb {/* small box in the scroll bar */border-radius: 5px;-webkit-box-shadow: inset 0 0 5px rgba (0, 0, 0, 0.2); background: rgba (0.2, 0 );}. innerbox:-webkit-scrollbar-track {/* track in the scroll bar */-webkit-box-shadow: inset 0 0 5px rgba (0, 0, 0, 0.2 ); border-radius: 0; background: rgba (0.1, 0 );}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.