Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

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!