Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence Cloud change font size of div in PDF Export

Wade Koehn November 13, 2015

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

1 vote
Milo Test
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.
November 13, 2015

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.

Wade Koehn November 14, 2015

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
TAGS
AUG Leaders

Atlassian Community Events