Forums

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

Some CSS stylng commands do not wok in {style} macro

Wolfgang Geithner
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!
May 3, 2012

Dear all,

this is something that really drives me mad...

I do not have admin right for our company wide confluence wiki. I do have admin rights for my space and I have author rights. However, I do not have the right to change the space style (at least the option is not available in the space's adminsection)

I try to change the look of my h* headings and I created a stylesheet with code of the following kind (example of h2):

h2 {

color: blue; <-- does not have any effect

margin-top: 12px; <-- does not have any effect

margin-bottom: 20px; <-- does not have any effect

margin-left: 6px; <-- does not have any effect

margin-right: 0px; <-- does not have any effect

padding-top: 50px; <-- does not have any effect

padding-bottom: 10px; <-- does not have any effect

padding-left: 5px; <-- does not have any effect

padding-right: 15px; <-- does not have any effect

background-color: #F0AB00; <-- works

text-indent: 20px; <-- works

width: 100%; <-- works

}

Whatever I tried, I couldn't make the options work which are marked as "do not have any effect". I'm desperate...

Any help appreciated, kind regards

Wolfgang

1 answer

1 accepted

2 votes
Answer accepted
Dennis Kromhout van der Meer
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.
May 3, 2012

This probably happens because the change does not carry enough importance over the inheritance of other stylesheets. You can change this by increasing the specificity or by marking the rule with !important. Here are two examples:

Specificity:

div#main div.wiki-content h2 {
    color: blue;
}

!important:

h2 {
    color: blue !important;
}

For more information, read the W3C document: Assigning property values, Cascading, and Inheritance

Wolfgang Geithner
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!
May 3, 2012

Cool! Works, thanks a lot

Dennis Kromhout van der Meer
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.
May 3, 2012

No worries, enjoy!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events