為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Context Menu and Dropdown menu Colors

  • 6 回覆
  • 2 有這個問題
  • 18 次檢視
  • 最近回覆由 Mozzin

more options

Hi all, I've a question, I've searched anywhere without a solution.

I need to change the menu color from default gray (RGB 240 240 240) to white (RGB 255 255 255)

Please help me, this is for a visually impaired person.

Thank you in advance!

Hi all, I've a question, I've searched anywhere without a solution. I need to change the menu color from default gray (RGB 240 240 240) to white (RGB 255 255 255) Please help me, this is for a visually impaired person. Thank you in advance!

所有回覆 (6)

more options

Firefox has numerous different context menus. Based on a post on the mozillaZine forums (link), these custom style rules will give three of them a white background:

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#contentAreaContextMenu * {
    background-color: #fff !important;
}
#tabContextMenu * {
    background-color: #fff !important;
}
#placesContext * {
    background-color: #fff !important;
}

Custom style rules can be applied to Firefox using either a userChrome.css file (a file you create, or if it exists, that you edit, which is read by Firefox when it starts up) or using an extension such as Stylish.


To apply the rule using the Stylish extension, step 1 is to install the Stylish extension: https://addons.mozilla.org/en-US/firefox/addon/stylish/

Next, select and copy the rule from earlier in this post.

To set it up:

(1) Stylish will add an "S" icon either to the main Navigation Toolbar or to the Add-on bar. Click the Stylish "S" icon > Write new style > Blank style.

(2) Click in the large editing area next to the faded "1" and paste in the rule.

(3) Click the Preview button to apply the rule. Success?

(4) Before saving the rule, type a name in the top box, for example: Context Menus White BG

That's it. Unless there's a problem in Step 3.

由 jscher2000 - Support Volunteer 於 修改

more options

Regarding other menus, is it the classic menu bar or the orange Firefox button menu? These have different CSS selectors (the hooks for applying style rules).

more options

Is this in the Firefox user interface?

You can see if you can find a complete (full) theme that has a setting to change this color.


Add code to the userChrome.css file below the default @namespace line.

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

menupopup { background-color: rgb(255,255,255) !important; -moz-appearance: none!important; }

The customization files userChrome.css (user interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.

more options

@jscher2000 Unfortunately your code doesn't work for me but thank you anyway for your time. Moreover I'm so happy to learn about Stylish extension and I will play immediately with it.

@cor-el Thank you so much, you solved my problem, your code is perfect for my needs. Only a question, I ask you if this code will work for a long time or probably it will change in the future. Thank you also from my sister, the visually impaired person that moved me to ask your help.

more options

You're welcome

This is a very generic code that only has a 'menupopup" selector that is very unlikely to get changed as this would involve to change all Firefox theme and CSS files that use this selector...

more options

Perfect, this is a real good news, so I will have this setting for a long time. Thank you so much cor-el, you are a good man!