【问题标题】:Make Scrollbar viable for Firefox让滚动条适用于 Firefox
【发布时间】:2020-07-05 01:42:56
【问题描述】:

我想让我的 div 的 css 滚动条对 Firefox 可见。我可以看到它在 Firefox 上不起作用,但在 chrome 上起作用。 这是我的CSS。

.ascenseur::-webkit-scrollbar
{
    width: 4px;
}
.ascenseur::-webkit-scrollbar-thumb
{
    border-radius: 10px;
    background-color: #7997cd;
}

【问题讨论】:

    标签: css google-chrome firefox scroll scrollbar


    【解决方案1】:

    我可能弄错了,但我相信目前 mozilla 支持滚动条样式的唯一 CSS 是:

    scrollbar-color: red green; (where red is the bar and green is thumb)
    scrollbar-width: thin; (other option is thick)
    

    有一些 javascript 滚动条选项可用于设置 Mozilla 滚动条的样式,但我对它们没有太多经验。

    你可以做的事情是这样的:

    @-moz-document url-prefix('') {
      .ascenseur {
        scrollbar-color: #7997cd green; (pick something not green)
        scrollbar-width: thin;
    }
    

    这会将替代样式仅应用于 mozilla (firefox),并允许其他浏览器使用您的原始样式。

    https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-16
      • 2021-09-26
      • 1970-01-01
      • 2015-06-06
      • 1970-01-01
      • 2014-09-04
      相关资源
      最近更新 更多