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

This widget could not be displayed.

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!

This widget could not be displayed.

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.

This widget could not be displayed.

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

This widget could not be displayed.

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
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

505 views 7 6
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