搜尋 Mozilla 技術支援網站

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

Learn More

firefox tabs close button

  • 7 回覆
  • 0 有這個問題
  • 107 次檢視
  • 最近回覆由 cor-el

more options

I am looking for a way to make the Firefox tab close button "x" bolder without affecting the background style. I tried using filter but I do not want any shadows or anything like that just to make the item itself not bigger but bolder - any ideas? Thank you all look4

I am looking for a way to make the Firefox tab close button "x" bolder without affecting the background style. I tried using filter but I do not want any shadows or anything like that just to make the item itself not bigger but bolder - any ideas? Thank you all look4

由 look4 於 修改

所有回覆 (7)

more options

You may be able to get an answer on the Reddit sub FirefoxCSS. I suspect you will need to create a userChrome.css file.

有幫助嗎?

more options

Hi Terry , of course I use the userchrome.css , that is how I tried the filter function that didn't do the trick. I cann't find anywhere any suggestions. thanks look4

有幫助嗎?

more options

That close X in a SVG file, but looks rather complicated to me to modify the thickness of the cross.

  • chrome://global/skin/icons/close.svg
  • view-source:chrome://global/skin/icons/close.svg

A possible alternative that uses a line (you need to escape '#' as %23 in a data URI):

data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity"><line x1="1.41" y1="1.41" x2="14.41" y2="14.41" fill="none" stroke="%23ff0000" stroke-linecap="round" stroke-width="3"></line><line x1="14.41" y1="1.41" x2="1.41" y2="14.41" fill="none" stroke="%23ff0000" stroke-linecap="round" stroke-width="3"></line></svg>

有幫助嗎?

more options

Hi cor-el, Sorry , I did not understand the alternative line. Could you please elaborate. Thanks look4

有幫助嗎?

more options

You can add CSS code to the userChrome.css file in the chrome folder in the Firefox profile folder. This code works for all close buttons with class name ".close-icon" like on the Tab bar and in the Sidebar (Bookmarks: Ctrl+B; History: Ctrl+H). You can replace ".close-icon" with ".tab-close-button" in place places to make this only work for the Tab bar


/* Close icon */
.close-icon {
  list-style-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22.83 22.83' width='16' height='16'><line x1='1.41' y1='1.41' x2='21.41' y2='21.41' stroke='context-fill' stroke-width='4' stroke-linecap='round'></line><line x1='21.41' y1='1.41' x2='1.41' y2='21.41' stroke='context-fill' stroke-width='4' stroke-linecap='round'></line></svg>") !important;

  padding: 2px !important;
  width: 16px !important;
}

/* Close icon color on hover */
.close-icon:hover {
  background-color: rgba(255,0,0,.7) !important;
  fill: white !important;
}

It is not that difficult to create userChrome.css if you have never used it.

The first step is to open the "Help -> Troubleshooting Information" page and find the button to access the profile folder with the random name (xxxxxxxx.default-release).

You can find the button to go to the profile folder under the "Application Basics" section as "Profile Folder -> Open Folder". If you click this button then you open the profile folder in the Windows File Explorer. You need to create a folder with the name chrome in the profile folder with the random name (name is all lowercase). In the chrome folder you need to create a plain text file with the name userChrome.css (name is case sensitive). In this userChrome.css text file you paste the text posted. On Mac you can use the TextEdit utility to create the userChrome.css file as a plain text file.

In Windows saving the file is usually the only time things get more complicated because Windows can silently add a .txt file extension and you end up with a file named userChrome.css.txt. To avoid this you need to make sure to select "All files" in the dialog to save the file in the text editor using "Save File as".

You need to close (Quit/Exit) and restart Firefox when you create or modify the userChrome.css file.

More info about userContent.css and userChrome.css in case you are not familiar: *https://www.userchrome.org/what-is-userchrome-css.html

In Firefox 69 and later you need to set this pref to true on the about:config page to enable userChrome.css and userContent.css in the chrome folder.

有幫助嗎?

more options

Thanks cor-el it works fine , is there a way using that code to make the "x" smaller a bit - thanks so much for your help. look4

有幫助嗎?

more options

Set can set the size by adjusting width: 16px !important; => width: 14px !important; or smaller.

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先登入帳號 來回覆文章。還沒有帳號的話,只能發問新問題