Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Learn More

Cannot style any children of .urlbarView.megabar in userChrome.css in Firefox 75

  • 5 odpowiedzi
  • 1 osoba ma ten problem
  • 1 wyświetlenie
  • Ostatnia odpowiedź od Alec Mev

more options

My userChrome.css:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.tab-line { display: none !important }
.urlbarView-body-inner { border-top: unset !important }
#urlbar-results { background: red !important }

The ".tab-line" rule is applied, the ".urlbarView-body-inner" and "#urlbar-results" rules aren't. Can anybody reproduce? What's wrong?

My userChrome.css: @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); .tab-line { display: none !important } .urlbarView-body-inner { border-top: unset !important } #urlbar-results { background: red !important } The ".tab-line" rule is applied, the ".urlbarView-body-inner" and "#urlbar-results" rules aren't. Can anybody reproduce? What's wrong?

Zmodyfikowany przez Alec Mev w dniu

Wybrane rozwiązanie

The Browser Toolbox shows that these element are inthe HTML namespace and thus need to be placed above the @namespace line.

.urlbarView-results {background: red !important;}

.urlbarView.megabar .urlbarView-body-inner {border-top: unset !important;}
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

Przeczytaj tę odpowiedź w całym kontekście 👍 1

Wszystkie odpowiedzi (5)

more options

You are looking for the urlbarView-row class items.

more options

I want to get rid of the 1px border at the top of the megabar. It's styled like so in browser.css:

.urlbarView.megabar .urlbarView-body-inner {
    width: 100%;
    border-top: 1px solid var(--urlbar-separator-color);
}

I'm trying to cancel out border-top by adding this to userChrome.css:

.urlbarView-body-inner {
    border-top: unset !important;
}

But there's no effect, the rule isn't even listed in the Rules of ".urlbarView-body-inner" in Browser Toolbox.

Zmodyfikowany przez Alec Mev w dniu

more options

Wybrane rozwiązanie

The Browser Toolbox shows that these element are inthe HTML namespace and thus need to be placed above the @namespace line.

.urlbarView-results {background: red !important;}

.urlbarView.megabar .urlbarView-body-inner {border-top: unset !important;}
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

more options

Either one of the following CSS codes work for me:

.urlbarView-body-inner {
    border-top: unset !important;
}

or

.urlbarView-body-inner {
    border-top: none !important;
}

Is this your first time working with userChrome.css modifications? Maybe you need to set the toolkit.legacyUserProfileCustomizations.stylesheets preference to true in the about:config page so that Firefox reads the CSS file. See Firefox Changes Breaking userChrome.css for more information.

more options

Thanks, cor-el! That was it.

Done some more googling, and looks like @-moz-document should be used instead of @namespace for scoping, to avoid silly issues like this.