Is there a way to manipulate section columns with CSS?

Florian Scheuer January 26, 2015

We are currently using sections to create two columns of our documents. I'd like to address each left column with a different CSS class than the sections on the right. However they do not seem to have those different classes (like "column-left" and "column-right"). Is there a way to accomplish this?


Thank you!

4 answers

1 accepted

2 votes
Answer accepted
Kirstin Seidel-Gebert
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.
January 26, 2015

In Confluence 5.5.2 the columns are displayed using div-elements. Means you should use something like

div.two-equal div:first-child {
Florian Scheuer January 26, 2015

Thanks, that worked in combination with CSS nth-child()!

Steffen Heller
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.
January 26, 2015

@Florian: Can you specify what kind of combination you are using? That interests me because nth-child() didn't work in my version.

1 vote
Maggie Modersohn
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.
January 26, 2015

Hi Florian, 

If you're looking for a way to do this that is built-in to the UI, check out our add-on Theme Press. Our columns, blocks and layers are macros to which you can add one or more CSS class names. You can also style columns and blocks without custom css (to make your next Confluence upgrade less of a headache) with our built-in designer tool. 

You can try it yourself or send us a note for a demo. 

Ricardo Martins January 26, 2015

Using Theme Press for column decoration you have two options: 1. Define an alternate block style and then check the box in the column in the Theme Press Designer to use that alternate styling 2. Add a CSS class to the column using the Theme Press Designer, then add custom CSS to target that. The first option is future proof, the second is not.

Tim
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.
January 26, 2015

Please stop posting your advertising messages where they do not belong and also stop pushing them up with your buddy. No one here has asked for a commercial theme add-on.

0 votes
Steffen Heller
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.
January 26, 2015

I agree with TtheB: ":first-child" does work (unlike ":last-child" or ":nth-child(x)").

I am just not sure about the right class. Does the section macro not simply create normal tables? I think the right code would be something like this:

table.sectionMacro td:first-child {
...
}
Steffen Heller
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.
January 26, 2015

Okay, my answer refers to Version 4.3.7. Seems it is not the same for different versions.

0 votes
Tim
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.
January 26, 2015

You could try and use

.columnMacro:first-child {

}

in your stylesheet.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events