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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

864 views 23 12
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