css3 - 关于滚动条的CSS如何设置问题

 mobiledu2502870743 发布于 2022-11-06 05:26

This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.

就像上面代码 p里面有一段文字,我设置了overflow:auto;也就是超出部分显示滚动条,那么我如何修改这个滚动条的样式呢?

4 个回答
  • 话说滚动更改滚动条样式。为什么pc端可以正常显示。手机端就不行了呢

    2022-11-12 01:56 回答
  • 推荐你参考这篇文章:http://www.qianduan.net/css-custom-scroll-bar-style/
    作者是微信团队的神飞,写的文章一直很不错!

    2022-11-12 01:56 回答
  • 那就定义浏览器滚动条样式即可,两者是一致的,如果需要不一样,那就需要模拟滚动条

    2022-11-12 01:56 回答
  • 一个针对Webkit内核浏览器的滚动条美化的例子,不知道是不是你想要的

    /* 滚动条部分 */
    ::-webkit-scrollbar {
        width:15px;
    }
    
    /* 轨道 */
    ::-webkit-scrollbar-track {
        -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
        -webkit-border-radius: 15px;
        border-radius: 15px;
    }
    
    /* 手柄 */
    ::-webkit-scrollbar-thumb {
        -webkit-border-radius: 15px;
        border-radius: 15px;
        background:rgba(200,200,200,0.7); 
        -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
    }
    /* 手柄激活态 */
    ::-webkit-scrollbar-thumb:window-inactive {
        background: rgba(200,200,200,0.4); 
    }
    2022-11-12 01:56 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有