PDF CSS - cannot change TOC font color

I'm following the doc instructions for "Adding a Dynamic Title to the Title Page". It works well.

/* Move and style this TOC item */
.toclvl0
{
position:absolute;
top:250px;
font-size: 42px;
font-weight: bold;
margin: 72px 0 4px 0;
text-align:center;
}

I've been able to change these values, plus add others like font-family etc...

However, when I try to specify a different color by adding

color:#fff;

to this list, it doesn't do anything. Why????

This ONLY happens in the TOC. I'm able to change colors on the h1, h2, etc..

Help!

3 answers

1 accepted

I don't fully understand the description at https://confluence.atlassian.com/display/DOC/Advanced+PDF+Export+Customisations#AdvancedPDFExportCustomisations-AddingaDynamicTitletotheTitlePage

But I think if you want to change the colour of the .toclvl0 item you should use

div.toclvl0 a {
color: pink;    
}

Better don't try with "color:#fff;" because that will be white and white text on a white background will be hard to recognize ;-)

Thanks so much, that worked!

Oh, and btw - I had the #fff for colour b/c I had been also looking for a way to hide the TOC so ONLY the toclvl0 would appear on the cover page as the PDF title. If you know a more correct way to do this, I'm all ears.

thanks again!

Take a look at the confluencedefaultpdf.css. That is the standard css that you want to change in part.

Everything toc related starts with the same word. I think "div.toc" should cover the whole toc, "div.toclvl0" and so on are the different headline levels and sometimes it is necessary to change the format of hyperlinks with "div.toc a" or "div.toclvl0 a".

If you want to hide or show parts play around with "color: white;" or "display: none;".

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,856 views 27 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you