Home > Web Front-end > CSS Tutorial > How to customize scroll bars in css (code)

How to customize scroll bars in css (code)

不言
Release: 2018-07-21 11:50:23
Original
2973 people have browsed it

This article shares with you how to customize the scroll bar (code) in CSS. The content is very good. Friends in need can refer to it. I hope it can help everyone.

html↓

<p></p>
Copy after login

css↓

.test {
      display: inline-block;
      margin: 60px 40%;
      width: 280px;
      padding: 5px 4px;
      min-height: 20px;
      line-height: 20px;
      max-height: 72px;
      border: 1px solid #ccc;
      font-size: 12px;
      word-wrap: break-word;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-user-modify: read-write-plaintext-only;
      border-radius: 4px;
    }
      .test::-webkit-scrollbar {
      width: 4px;
      height: 1px;
    }
    .test::-webkit-scrollbar-thumb {
      border-radius: 4px;
      -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
      background: #C8C8C8;
    }
    .test::-webkit-scrollbar-track {
      border-radius: 4px;
      background-color: #FFFFFF;
    }
Copy after login

Rendering

How to customize scroll bars in css (code)

Related recommendations:

How to use Css to achieve the effect of rounded borders

Realize css Two ways of dotted line style: dotted and dashed (example)

The above is the detailed content of How to customize scroll bars in css (code). 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template