Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to use inline CSS in confluence?

Avinash July 25, 2012

Hi,

I am trying to change the look and feel of very few elements in a page. I don't want to go through the process of using CSS as a file and make changes to my page. Is there a way i can do it inline ie code CSS along with wiki markup ?

Thanks

3 answers

2 votes
Avinash July 25, 2012

I just found it. You can add CSS styles to confluence content this way:

{style} h2 {font-size: 15px; color:#006600;} {style}

But, Any styles you define within the content of a Confluence page come after Confluence's master style sheets - so any property that has already been defined by your space's theme can't be redefined. Digging around with the Web Developer Firefox Add-ons can help you figure out what's already been defined, and what can be styled.

Swapna Gupta March 13, 2014

Thanks, this is a cool trick.

1 vote
Amalia
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.
July 25, 2012

You can actually use HTML macro to achieve that. You can change the CSS styles for all contents by adding !important on the styles

E.g.

h2 {
font-size: 15px !important;
color:#006600 !important;
}

Avinash July 25, 2012

You mean to say u can wrap this code around {html} and it'll work? But the problem is {html} is restricted due to security reasons and i dont have admin privilages :( But,Thanks!

Avinash July 29, 2012

Is there a way to do it without using the html macro?

0 votes
Rachel Dunlop July 25, 2012

Can you do this in all versions? I'm running 3.3.1 and all I get is "Unknown macro" :(

Avinash July 25, 2012

I am not sure about that as im using 3.5

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events