1、
overflow:hidden;
overflow:scroll;
2、
如果要出现程度滚动条,则: overflow-x:auto
如果要垂直滚动条则为: overflow-y:auto
留意:肯定要设置宽高
width:400px; height:400px;
3、纯色滚动条
- /* 整个滚动条 */
- ::-webkit-scrollbar {
- /* 对应纵向滚动条的宽度 */
- width: 10px;
- /* 对应横向滚动条的宽度 */
- height: 10px;
- }
- /* 滚动条上的滚动滑块 */
- ::-webkit-scrollbar-thumb {
- background-color: #49b1f5;
- border-radius: 32px;
- }
- /* 滚动条轨道 */
- ::-webkit-scrollbar-track {
- background-color: #dbeffd;
- border-radius: 32px;
- }
复制代码 4、花色滚动条
- /* 整个滚动条 */
- ::-webkit-scrollbar {
- width: 10px;
- height: 10px;
- }
- /* 滚动条上的滚动滑块 */
- ::-webkit-scrollbar-thumb {
- background-color: #49b1f5;
- /* 关键代码 */
- background-image: -webkit-linear-gradient(45deg,
- rgba(255, 255, 255, 0.4) 25%,
- transparent 25%,
- transparent 50%,
- rgba(255, 255, 255, 0.4) 50%,
- rgba(255, 255, 255, 0.4) 75%,
- transparent 75%,
- transparent);
- border-radius: 32px;
- }
- /* 滚动条轨道 */
- ::-webkit-scrollbar-track {
- background-color: #dbeffd;
- border-radius: 32px;
- }
复制代码
参考链接:
http://t.csdn.cn/mTtW9
来源:https://blog.csdn.net/qq_66061193/article/details/130060321
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |