Confluence Cloud change font size of div in PDF Export

I have some content wrapped in a div macro that I am trying to set to a smaller font size. (8pt) I have already added this to the PDF Export Stylesheet to control the font of the whole document and it works correctly:

body,p,li,td,table,tr,.bodytext,.stepfield {
    font-size: 11pt;
}

 

But I cannot get this to work at all:

div.smalltext {
    font-size: 8pt;
}

 

This does work however:

div.smalltext {
    display: none;
}

so I think I am selecting it correctly there must just be something with the font I do not understand?

What is even stranger is that it is affecting the display in Confluence as if I had added it to the stylesheet for this space and not the PDF stylesheet...??????? The content inside of my div.smalltext is displaying in my browser at a smaller font size but when I export it goes back to the standard size font.

 

Since I cannot post more than one comment or question per day I will add to my original question:

I tried:

div.smalltext {
    font-size: 80%;
}

and also using em. The only way I can get it to work is by changing my previous code:

body,p,li,td,table,tr,.bodytext,.stepfield {
    font-size: 11pt;
}

to n% or nem. Then the div.smalltext works correctly. I think I understand what you mean by fixed size and surrounding text but I tried setting the div.smalltext font-size value from 8pt all the way to 20pt and the size of the text still did not change...

1 answer

The use of npt will result in a fixed size, so if the text around it is already equivalent to the size, you won't see a difference. It is better web practice to use nem or n% to better predict what the visual difference will be.

Try those designations to see what the results are.

I could only post one question a day so I edited my original post to include more info.

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
Published 10 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

92 views 2 4
Read article

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