The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How do I change the color of the text in my TOC (added as a macro)?

Geraldine Flanagan
March 1, 2012

I added a TOC to my page but I want to change the color of the text so it is different than the other text on the page. I assume I have to use CSS but I have no idea what to add into the CSS stylesheet. Any help would be greatly appreciated!

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
BenA
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 Champions.
March 4, 2012

You need to edit the TOC and add a CSS Class Name via the dialog, eg. "mytocclass". That gets applied to the DIV around the TOC list.

Then style away (I'm assuming you already know where to put the CSS), noting some selectors will need to be quite strong to apply over the existing CSS. A simple trick is to start with an ID selector eg:

#com-atlassian-confluence .mytocclass ul li a { background: green; color: white; }

Hope that helps.

Geraldine Flanagan
March 4, 2012

Thank you so much Ben, that did the trick!!!

John Guerra
July 22, 2012

I am using the ā€˜Table of Contents’ Macro and would like to edit the CSS. I am assuming this is done via the "CSS Class Name" field in the macro.

However, it seems that if you are using OnDemand, you can not do this. Can you explain "where to put the CSS"?

Thankyou.

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 Champions.
July 22, 2012

@John:

You could try the following:

Enter something like "mytocclass" to the "CSS Class Name" field of the toc macro and then define the mytocclass in the Browse > Space Admin > Look and Feel > PDF Stylesheet by entering something like

.mytocclass a {
color:red;
}

TAGS
AUG Leaders

Atlassian Community Events