How to hide the "spaces"-Button in Confluence Cloud
Asked by Nils Merkle:

*This question is in reference to Atlassian Documentation: [How to hide elements in Confluence using CSS or JavaScript](https://confluence.atlassian.com/pages/viewpage.action?pageId=313458894)*

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?


Answers:
author: Stephen Deutsch
body: Seems like it's changed in more recent versions of Confluence to #space-menu-link :smile:

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


author: K. Yamamoto
body: Since SPA is enabled, the workaround introduced here is no longer available. Please vote for <https://jira.atlassian.com/browse/CONFCLOUD-57870> if you want an option to hide sidebar from anonymous users.

comments: author: Glenn Engel
body: Looks like Atlassian closed this issue. However, this one is still open for voting: [https://jira.atlassian.com/browse/CONFCLOUD-58921.](https://jira.atlassian.com/browse/CONFCLOUD-58921.?) Get your votes in before they ignore our feedback and close it!


author: Chris Ang
body: Agree, we need this also. Disappointed they don't offer this as I am sure many customers use the platform for documentation like us. Where we do not want certain information such as Activity and Page History or Space Settings open for everyone!

I couldn't add a comment in that ticket above but added my vote!


author: Bryan Krenzin
body: this is completely nuts. As an anonymous user with browse only, i can click on the upper left icon (home), navigate to spaces folder, then click on other peoples stuff.


author: Byron
body: I can't believe such a simple feature is not available. We too want the ability to provide anonymous access to specific spaces without people being able to see all spaces with anonymous access enabled. Is there not a workaround for this?


author: Wendy Podgursky
body: 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. <https://confluence.atlassian.com/confcloud/restricted-functions-in-confluence-cloud-734070955.html>.

comments: author: Nils Merkle
body: 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:


author: Stephen Deutsch
body: 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).


author: Philip Schlesinger
body: 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)


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

AJS.$("#title-text").css("color","red")


author: Hazwan
body: TEST  

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:

{style}#title-text{style}

But if I open the Chrome Developer Console and type:  
AJS.$("#title-text").css("color","red")  
My page title indeed turns red. Help?


author: Stephen Deutsch
body: 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.


author: Philip Schlesinger
body: Atlassian won't let me post the same response in two places so let's continue the conversation here: <https://community.atlassian.com/t5/Confluence-questions/Re-Re-Is-custom-CSS-not-allowed-in-Confluence-Cloud/qaq-p/612166/comment-id/81877#M81877>


author: Petro Romanchuk
body: Hello [@Nils Merkle](/t5/user/viewprofilepage/user-id/734038),  

Could you please explain me step-by-step about what exactly place of Confluence Cloud administration menu did you use to paste this peace of CSS code?  


author: Nils Merkle
body: Hello [@Petro Romanchuk](/t5/user/viewprofilepage/user-id/1719012),

it inso longer possible to use CSS in Confluence Cloud. I'm sorry...


Tags: cloud

confluence-cloud

css

display

documentation

hide