X
Kliknite sem pre prechod na mobilnú verziu webu.

Fórum podpory

How do I hide the close X on all tabs (including the active tab)?

Pridané

Currently, the X doesn't show on tabs other than the active tab. Ideally, I don't want the X on the active tab either. The stanza I am using in userChrome.css is

.tab-close-button{ display: none !important } (suggested in a post in GitHub) This is the current stanza and doesn't hide the X on the active tab.

I have tried setting the value of browser.tabs.tabClipWidth to 9999 as suggested in another question and that doesn't get rid of the X on the active tab. I have also tried the following css solution :

#tabbrowser-tabs .tabbrowser-tab .tab-close-button { display:none!important; }
(also suggested in another question but it doesn't hide the X on the active tab)

I searched for an extension and got a lot of links; I looked through the first three pages and nothing relevant was listed.

Currently, the X doesn't show on tabs other than the active tab. Ideally, I don't want the X on the active tab either. The stanza I am using in userChrome.css is <pre>.tab-close-button{ display: none !important } (suggested in a post in GitHub) This is the current stanza and doesn't hide the X on the active tab.</pre> I have tried setting the value of browser.tabs.tabClipWidth to 9999 as suggested in another question and that doesn't get rid of the X on the active tab. I have also tried the following css solution : <pre>#tabbrowser-tabs .tabbrowser-tab .tab-close-button { display:none!important; }</pre> (also suggested in another question but it doesn't hide the X on the active tab) I searched for an extension and got a lot of links; I looked through the first three pages and nothing relevant was listed.

Upravil(a) ender21 dňa

Vybrané riešenie

What worked is using two stanzas together, thus :

#tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none !important}
#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button {
  display: none !important;}

I also tried using the second stanza alone; that didn't work.

Čítať túto odpoveď v kontexte 0
Citácia

Ďalšie informácie o systéme

Nainštalované zásuvné moduly

  • Shockwave Flash 25.0 r0

Aplikácie

  • Identifikácia prehliadača: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Viac informácií

WestEnd
  • Top 10 Contributor
53 riešení 2704 odpovedí

For css usage you should contact the site that created the css your using for how they configure changes from the default FF settings.

For css usage you should contact the site that created the css your using for how they configure changes from the default FF settings.
Pomohlo vám to? 0
Citácia
cor-el
  • Top 10 Contributor
  • Moderator
16461 riešení 148511 odpovedí

That code should work.

Are you sure that there isn't a problem with the userChrome.css file you created?


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 */

#tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none!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.

You can find this button 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 this folder (name is all lowercase). In the chrome folder you need to create a text file with the name userChrome.css (name is case sensitive). In this userChrome.css text file you paste the text posted.

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". Check that the file doesn't have a double .css file extension (userChrome.css.css).

You need to close and restart Firefox when you create or modify the userChrome.css file.

That code should work. Are you sure that there isn't a problem with the userChrome.css file you created? ---- Add code to the <b>userChrome.css</b> file below the default @namespace line. *http://kb.mozillazine.org/userChrome.css <hr> <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ #tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none!important} </nowiki></pre> <hr> 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. *https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox You can find this button 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 <u>chrome</u> in this folder (name is all lowercase). In the <b>chrome</b> folder you need to create a text file with the name <u>userChrome.css</u> (name is case sensitive). In this userChrome.css text file you paste the text posted. 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 <i>userChrome.css.txt</i>. 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". Check that the file doesn't have a double .css file extension (userChrome.css.css). You need to close and restart Firefox when you create or modify the userChrome.css file.
Pomohlo vám to? 0
Citácia

Autor otázky

Thanks for the replies. I know how to create a userChrome.css file. I have been using one for years. It doesn't have a double .css extension. I restarted after trying each option.

Thanks for the replies. I know how to create a userChrome.css file. I have been using one for years. It doesn't have a double .css extension. I restarted after trying each option.
Pomohlo vám to?
Citácia

Autor otázky

I have just re-added the following stanza (and commented out the other) after exiting Firefox then restarted Firefox. The X is still on the active tab.

I have just re-added the following stanza (and commented out the other) after exiting Firefox then restarted Firefox. The X is still on the active tab.
Pomohlo vám to?
Citácia
cor-el
  • Top 10 Contributor
  • Moderator
16461 riešení 148511 odpovedí

Does other code in the file work?

Firefox would normally hide the close X on other tabs in case a lot of tabs are open, so may test this with only two of three tabs open.


Can you attach a screenshot that shows this file?

Does other code in the file work? Firefox would normally hide the close X on other tabs in case a lot of tabs are open, so may test this with only two of three tabs open. ---- Can you attach a screenshot that shows this file? *https://support.mozilla.org/en-US/kb/how-do-i-create-screenshot-my-problem *use a compressed image type like PNG or JPG to save the screenshot
Pomohlo vám to?
Citácia

Autor otázky

Thanks for replying. Most of the code in the file works. There are two stanzas relating to the colours of tabs which don't work as expected.

I currently have 20 tabs open. I suppose you don't want a screen shot of the width of the screen so my screen shot shows only the active tab and two tabs on either side.

Thanks for replying. Most of the code in the file works. There are two stanzas relating to the colours of tabs which don't work as expected. I currently have 20 tabs open. I suppose you don't want a screen shot of the width of the screen so my screen shot shows only the active tab and two tabs on either side.
Pomohlo vám to?
Citácia
jscher2000
  • Top 10 Contributor
7537 riešení 61432 odpovedí

Somewhere in a built-in style sheet for Windows, I found a rule that had a more detailed (more specific) chain, so I have been using this to modify the tab close button. You could try it with your display:none preference:

#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button {
  display: none !important;
}

Please do not trust email confirmations with CSS, always copy from the forum. Especially because we sometimes notice a typo and fix it here, but no new email is generated.

Somewhere in a built-in style sheet for Windows, I found a rule that had a more detailed (more specific) chain, so I have been using this to modify the tab close button. You could try it with your display:none preference: <pre>#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button { display: none !important; } </pre> Please do not trust email confirmations with CSS, always copy from the forum. Especially because we sometimes notice a typo and fix it here, but no new email is generated.
Pomohlo vám to?
Citácia

Autor otázky

jscher2000 said

Somewhere in a built-in style sheet for Windows, I found a rule that had a more detailed (more specific) chain, so I have been using this to modify the tab close button. You could try it with your display:none preference:
#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button {
  display: none !important;
}

Please do not trust email confirmations with CSS, always copy from the forum. Especially because we sometimes notice a typo and fix it here, but no new email is generated.

Thanks. I have copied that code. What do you mean by "with your display:none preference"? Is your code to be used along with the following?

#tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none!important}

I have just noticed that there is no space between 'none' and'!' I'll fix that and restart. No, adding a space made no difference.

''jscher2000 [[#answer-1141551|said]]'' <blockquote> Somewhere in a built-in style sheet for Windows, I found a rule that had a more detailed (more specific) chain, so I have been using this to modify the tab close button. You could try it with your display:none preference: <pre>#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button { display: none !important; } </pre> Please do not trust email confirmations with CSS, always copy from the forum. Especially because we sometimes notice a typo and fix it here, but no new email is generated. </blockquote> Thanks. I have copied that code. What do you mean by "with your display:none preference"? Is your code to be used along with the following? <pre>#tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none!important}</pre> I have just noticed that there is no space between 'none' and'!' I'll fix that and restart. No, adding a space made no difference.

Upravil(a) ender21 dňa

Pomohlo vám to?
Citácia
the-edmeister
  • Top 10 Contributor
  • Moderator
5285 riešení 39183 odpovedí

Try using a space between none and !important

none !important

#tabbrowser-tabs .tabbrowser-tab .tab-close-button 
{display:none !important} 
Try using a space between '''none''' and '''!important''' none !important <blockquote><pre><nowiki> #tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none !important} </nowiki></pre></blockquote>
Pomohlo vám to?
Citácia

Autor otázky

the-edmeister said

Try using a space between none and !important none !important
#tabbrowser-tabs .tabbrowser-tab .tab-close-button 
{display:none !important} 

Thanks. I made that change earlier (after exiting Firefox) and restarted Firefox. The change made no difference.

''the-edmeister [[#answer-1141557|said]]'' <blockquote> Try using a space between '''none''' and '''!important''' none !important <blockquote><pre><nowiki> #tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none !important} </nowiki></pre></blockquote> </blockquote> Thanks. I made that change earlier (after exiting Firefox) and restarted Firefox. The change made no difference.
Pomohlo vám to?
Citácia
jscher2000
  • Top 10 Contributor
7537 riešení 61432 odpovedí

Užitočné odpovede

ender21 said

jscher2000 said
#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button {
  display: none !important;
}
Thanks. I have copied that code. What do you mean by "with your display:none preference"? Is your code to be used along with the following?

No additional rules needed. What I posted is a complete solution for hiding all tab close buttons, tested on Firefox 61 on Windows 7.

''ender21 [[#answer-1141555|said]]'' <blockquote> ''jscher2000 [[#answer-1141551|said]]'' <blockquote> <pre>#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button { display: none !important; } </pre> </blockquote> Thanks. I have copied that code. What do you mean by "with your display:none preference"? Is your code to be used along with the following?</blockquote> No additional rules needed. What I posted is a complete solution for hiding all tab close buttons, tested on Firefox 61 on Windows 7.
Pomohlo vám to? 1
Citácia

Vybrané riešenie

What worked is using two stanzas together, thus :

#tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none !important}
#tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button {
  display: none !important;}

I also tried using the second stanza alone; that didn't work.

What worked is using two stanzas together, thus : <pre>#tabbrowser-tabs .tabbrowser-tab .tab-close-button {display:none !important} #tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button { display: none !important;}</pre> I also tried using the second stanza alone; that didn't work.

Upravil(a) ender21 dňa

Pomohlo vám to?
Citácia
jscher2000
  • Top 10 Contributor
7537 riešení 61432 odpovedí

Užitočné odpovede

Use <pre> before and </pre> after code blocks.

For some reason, there is a closing } missing after the second rule.

Use &lt;pre> before and &lt;/pre> after code blocks. For some reason, there is a closing } missing after the second rule.
Pomohlo vám to? 1
Citácia

Autor otázky

jscher2000 said

Use <pre> before and </pre> after code blocks. For some reason, there is a closing } missing after the second rule.

Thanks. Edited accordingly.

''jscher2000 [[#answer-1141743|said]]'' <blockquote> Use &lt;pre> before and &lt;/pre> after code blocks. For some reason, there is a closing } missing after the second rule. </blockquote> Thanks. Edited accordingly.
Pomohlo vám to?
Citácia
cor-el
  • Top 10 Contributor
  • Moderator
16461 riešení 148511 odpovedí

It is not necessary to leave a space before and after the "!", it should work either way. The Firefox source code use these spaces to make it easier to spot the important flag (display: none ! important;)

Did you test the code with only two or three tabs open like I suggested above?

It is not necessary to leave a space before and after the "!", it should work either way. The Firefox source code use these spaces to make it easier to spot the important flag (display: none ! important;) *https://developer.mozilla.org/Web/CSS/Specificity Did you test the code with only two or three tabs open like I suggested above?
Pomohlo vám to?
Citácia

Autor otázky

cor-el said

It is not necessary to leave a space before and after the "!", it should work either way. The Firefox source code use these spaces to make it easier to spot the important flag (display: none ! important;) Did you test the code with only two or three tabs open like I suggested above?

Thanks. I didn't test the code with only two or three tabs open. Is there any need for that now that I have code that works? I always save the session when exiting so I would have to close tabs I want to save.

''cor-el [[#answer-1141782|said]]'' <blockquote> It is not necessary to leave a space before and after the "!", it should work either way. The Firefox source code use these spaces to make it easier to spot the important flag (display: none ! important;) *https://developer.mozilla.org/Web/CSS/Specificity Did you test the code with only two or three tabs open like I suggested above? </blockquote> Thanks. I didn't test the code with only two or three tabs open. Is there any need for that now that I have code that works? I always save the session when exiting so I would have to close tabs I want to save.
Pomohlo vám to?
Citácia
Položiť otázku

Ak chcete pridať odpoveď, musíte sa prihlásiť k svojmu účtu. Ak účet doteraz nemáte, položte novú otázku.