Editing CSSs in Confluence OnDemand

If you are using Confluence OnDemand, can you edit the CSSs for online topics or for exported PDF documents? In the user guide, the topic "Styling Confluence with CSS" gives me the impression that you cannot.

7 answers

1 accepted

Well, actually I was about to settle with the "no css styling in OnDemand" restriction, until I found a really good workaround, by making use of the "{style}" macro.

Go to Space Admin > Themes and select "Configure theme" for your current theme. In the header text you can now use the "{style}" macro like so:

  .wiki-content h1 { 
    border-bottom: 1px solid #98bddd !important; 
  a.blogHeading {
    font-size: 14pt !important;
  .blog-post-listing .wiki-content {
    color: #637687 !important;

Works like a charm in our OnDemand instance and I hope Atlassian keeps this option open for us who want to customize the look and feel of our spaces.

I've never used the {style} macro, but it seems to apply to only one page. This doesn't sound practical for a whole document.

Wisherut, if you look at the description of the header text of a theme you'll see that it says: "Display a banner or text at the top of every page in this space by entering wiki markup here.". And that's exactly how it works. Hence, all CSS rules specified here are all applied to all pages within the space. Copy and paste my example and see for yourself.

Very helpful, thanks Pascal

They should include this in their proper documentation, it's very handy.

Thank you so much!!!!!

I even love the css codes that you provided as an example smile

Hmm, apparently the Documentation Theme has been discontinued in OnDemand.  The default theme does not appear to allow you to "Configure theme", so I'm not seeing a way to apply Pascal's workaround.  Does anybody have a solution for this?

The Style macro no longer works for OnDemand (a.k.a. Cloud) Confluence in the Admin Theme Header/Sidebar/Footer/etc. areas.

Entering a style block in the Header...

  .myCSSclass {
    color: #ff0000;

Will cause the following to appear in the source code:

Unknown macro: { color}

Fortunately, entering good old CSS in the Style macro still works just fine on a standard page.  The macro works a bit differently (which is good!) in that the contents of the macro are the CSS styles themselves, rather than content to be displayed.  It is also possible to point the macro at an external CSS file using the Import attribute of the Style macro.

.myCSSclass {
  color: red;
  font-weight: bold;
  /* etc. */ 

P.S. While editing the style, the tab key does what you want it to do!

When done creating/editing styles, apply them to the contents of Div macros, using the class attribute.

This is cumbersome to apply across multiple pages, but at least custom styles are still possible.

Yes, this macro allows you to style certain things on a page in Confluence Cloud . However, it seems to cause the entire page to be rendered in an iframe, which in turn causes the entire page to be surrounded with whitespace that does not belong there.

Any solutions to that?

Hi Wisherut,

I'm sorry to say that styling Confluence OnDemand with CSS is classified as one of the restricted functions for the OnDemand platform, so this isn't permitted as per our policy on the restricted functions on the OnDemand platform: https://confluence.atlassian.com/display/AOD/Restricted+Functions+in+Atlassian+OnDemand

Therefore, if you require to stylise your Confluence instance or customise your .PDF export templates then youy will need to migrate to a self-hosted instance of Confluence.

All the best,

Does that apply PDF output, too? I've been trying unsuccessfully to experiment with customizing PDF output. For example, I wanted to use the HTML code in one of your examples to create a customized title page. Some of your instructions directed me to identify the location of an image that I wanted to put on the title page, but when I right-clicked on the image to get the location, the location was not available.

Where is this option? For OnDemand Confluence 5.0, I can see Confluence Admin -> Themes, but there is no option for "Configure theme". Cheers.

This is an essential feature that I would love to have. Being unable to adjust the font size and padding is a massive weakness in the OnDemand offering.

@Jason, sorry... I forgot to mention that theme configuration is not available for every theme. We primarily use the Documentation Theme and it's available for that in "Space Admin > Themes" under the descriptive text of the Documentation Theme.

Fantastic. Thanks for clarifying this. I can resize fonts.


.wiki-content p {

font-size: 12px;



To add to what Pascal Lindelauf said, this can also be done globally in Confluence Cloud. Go to Confluence administration → [Look and Feel] Sidebar, header and footer.

I found the pre and code tags not to be distinctive enough, so I added this:

{style} code, pre { background-color: rgb(238,238,238) ; } {style}

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published Tuesday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

445 views 6 16
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot