Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Use Inline CSS in HTML Page Pushed via Confluence REST API (v2)

Florent Lambrette
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 11, 2025

Hi,

I'm currently pushing fully-formed HTML content to Confluence Cloud using the v2 REST API, specifically in the storage representation.

However, I’ve noticed that any <style> tags or inline CSS declarations (e.g., <div style="...">) are either stripped out or ignored when the page is rendered in Confluence. This happens even when the content is well-formed and valid HTML.

My use case is to generate and upload formatted tables or reports, and I need consistent visual formatting — especially for things like tooltips and font styling.

Is there any documented limitation or workaround for including inline CSS in pages created/updated via the REST API?

Thanks in advance for your help!

2 answers

1 accepted

0 votes
Answer accepted
Lucas Knorr
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2025

Hi @Florent Lambrette

You can’t use arbitrary CSS styling in Confluence. Instead, Confluence has its own set of markup and styling options. You can find the documentation here — it should be the same for both Cloud and Data Center. 
I’d recommend manually creating a test page that includes all the styling options available in your Confluence instance (including any formatting features added by 3rd-party apps) and reverse-engineer the format from there. You can always inspect the storage format of that page, which is also the format used when creating pages via the REST API.

 

 

0 votes
Florent Lambrette
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2025

Thank you @Lucas Knorr  ! it helped me

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events