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

搜尋 Mozilla 技術支援網站

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

了解更多

userChrome.css - cant figure out the right syntax

  • 3 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 pedyngro

more options

I have a transparent #nav-bar and I want all the buttons on this bar to be opaque. But when I set the background-color of any button to white, it doesnt respect the shape of the button and it makes a big rectangle over the whole bar height. But I want to change only the smaller rectangle with rounded corners, which I can see when I hover the button. Im experiencing the same problem with the background-color of .tabbrowser-tab. Is there any syntax solving this issue? Any help appreciated.

I have a transparent #nav-bar and I want all the buttons on this bar to be opaque. But when I set the background-color of any button to white, it doesnt respect the shape of the button and it makes a big rectangle over the whole bar height. But I want to change only the smaller rectangle with rounded corners, which I can see when I hover the button. Im experiencing the same problem with the background-color of .tabbrowser-tab. Is there any syntax solving this issue? Any help appreciated.

所有回覆 (3)

more options

After hours of googling and trying I found a working code. Opaque buttons in transparent toolbar:

.toolbarbutton-icon, .toolbarbutton-badge-stack{

   background-color: white !important;

}

But I still cant figure out the syntax for hover and active...

more options

Hello there, you'll need to forward more info about the css you are using there, the "!important" only helps when website is ignoring style so you put important to set it in front. anyway the basic syntax for "hover" and "active":

.[style]:hover {

     ...

}

.[style]:active {

     ...

}

由 rety 於 修改

more options

Thanks for a reply. I know, that the "!important" is sometimes superfluous, but it can't make something wrong, can it?

My problem: the syntax .tabbrowser-tab:not([selected]):hover .tab-content {} works fine, while .toolbarbutton-icon:hover, .toolbarbutton-badge-stack:hover{} doesn't work at all.

This is the whole (working) content of my userChrome.css:

.tabbrowser-tab .tab-background{background-color: rgba(242,241,244,0.7) !important;}

#nav-bar{background-color: transparent !important;}

.urlbar-page-action {display: none;}

#urlbar{opacity: 0.9 !important;}

.tabbrowser-tab:not([selected]):hover .tab-content {background-color: rgba(255,106,11,0.3) !important;}

.toolbarbutton-icon, .toolbarbutton-badge-stack{background-color: rgba(242,241,244,0.85) !important;}