CSS only works in Preview

I'm not an adminstrator and fairly new to Confluence. I'm trying to add a simple page that looks fine in a browser and not so great when added through an html macro but still. I attached a css file and made a reference to this document and in Preview mode it seems the html is 'listening' to the style sheet. However when I save the page it seems the css is no longer used.. could my style sheet be overruled in some way?

4 answers

So, My team and I recently ran aground on this same issue.  did you check to see if your Styling is in the head of your HTML file?  If so, move that into the body.  the HTML macro does not read the header of the HTML file.  

Once I put what I need in the body it works. We need to use div otherwise the formatting will affect confluence itself and create a mess. Thank you!

How did you attach the file: Did you use the CSS macro and choose a CSS file at "Import"?
If so, this only works for PDF exports but doesn't change the appearance of the confluence/html page.

I tried several ways. The CSS macro and inline CSS. Both work in preview mode but once saved all styling is gone.

I talked nonsense. The CSS macro does actually change the page itself. I didn't even know that.

@John: When I try, it works: Including formats with the {CSS} macro, the styling both shows in preview mode and when the page is saved.

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,942 views 27 12
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