How to hide the "spaces"-Button in Confluence Cloud

This question is in reference to Atlassian Documentation: How to hide elements in Confluence using CSS or JavaScript

Thanks to Atlassians Documentaion I was able to hide every Button, I don#t want to be displayed in my Confluence Cloud. The only element that didn't respond to my CSS command (display:none;), is the #space-directory-link.

Has anyone a solution for my problem?

3 answers

1 accepted

1 vote
Stephen Deutsch Community Champion Jul 10, 2016

Seems like it's changed in more recent versions of Confluence to #space-menu-link smile

Did work. I just wonder, why I didn't get that information out of the page source... Anyway. It did work! Thank you!

Hey Nils - can you confirm that you've got this working on Confluence Cloud. If so, I'd love to know how you got the custom CSS working. Supposedly this is a restricted function on Cloud.

Hey Wendy, yes I can. Here's y Stylesheet. Everything worked just fine:

#comments-section, #labels-section, #likes-section, .page-metadata, #page-metadata-banner, #breadcrumb-section, #navigation, #space-directory-link, #people-directory-link, #quick-create-page-button, #create-page-button, #space-menu-link, .aui-header-before, div.aui-header-before, div.aui-header-secondary { display: none }


Guess I did hide a lot smile

Stephen Deutsch Community Champion Jul 25, 2016

It's technically a restricted function, but since the recent addition of customizations to the sidebar, header, and footer using wiki markup in the standard theme, it is possible. Because Confluence Cloud has the Content Formatting Macros built in, they include the "CSS" macro ({style}) which lets you add CSS to a single page, so you can simply include your desired CSS either in the header or the footer of the page between two {style} tags and then your CSS will be applied either to the entire space or to all pages (depending on if you include it in the space customizations or site customizations, respectively).

Doesn't work for me.  I put in both the header and footer (open curly) style (close curly) #title-text (open curly) color:red (close curly) (open curly) style (close curly)

The title stubbornly remained #515151.


(sorry about the encoding...answers is apparently blocking me when I try to write the actual curly brackets)

And yet after the page loads, if I run the following in the Chrome Dev Console, the title text turns red as expected:




HI Stephen, I'm trying to do CSS styling in Confluence Cloud.
I placed the following code in my header and footer...and the title of my page didn't change red:


But if I open the Chrome Developer Console and type:
My page title indeed turns red. Help?

Stephen Deutsch Community Champion Jul 19, 2017

If you want to change the title color, then the following should work on Confluence Cloud which hasn't been upgraded to the new style:

{style}#title-text a{color: red}{style}

If you've been upgraded to the new ADG3 style, first of all, header and footer text doesn't appear to be working (as of this moment) at all. Secondly, even if it was working, the content of the page is now displayed in an iframe, so the style macro will only affect page content and can no longer affect anything outside of the page content frame.

0 vote

Since SPA is enabled, the workaround introduced here is no longer available. Please vote for if you want an option to hide sidebar from anonymous users.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,811 views 26 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you