代码之家  ›  专栏  ›  技术社区  ›  brandizzi

如何设置Firefox URL栏的背景色?

  •  0
  • brandizzi  · 技术社区  · 5 年前

    我正在尝试使用以下命令更改Firefox URL栏的背景颜色 userChrome.css . 下列的 these steps ,我将下面的代码添加到我的 userChrome.css :

    @-moz-document url(chrome://browser/content/browser.xul),
                   url(chrome://browser/content/browser.xhtml) {
        #urlbar {
            background-color: red !important;
        }
    }
    

    它根本不起作用。我怎样才能做到呢?

    1 回复  |  直到 5 年前
        1
  •  1
  •   brandizzi    5 年前

    首先,您需要设置 toolkit.legacyUserProfileCustomizations.stylesheets 偏爱 true 在里面 about:config ,如上所述 here .

    现在,要使用的正确CSS标识符是 #urlbar-background :

    @-moz-document url(chrome://browser/content/browser.xul),
                   url(chrome://browser/content/browser.xhtml) {
        #urlbar-background{
            background-color: red !important;
        }
    }
    

    (这是我从学校学到的 this file

    推荐文章