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 to center PDFs in confluence

Bethany.Conner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 18, 2024

Does anyone know if there is a way to center PDFs in Confluence, within a Layouts Macro? I'd love for this PDF to be centered underneath my text, but don't see an option to move it. It always sits to the left. 

 

I've tried adding a table within the layouts macro, and moving the table around, but that doesn't seem to work either. 

centerpdfinconfluenceproblem.png

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Humashankar VJ
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.
October 20, 2024

Hi @Bethany.Conner 

To center a PDF within a Layouts Macro in Confluence reliably, utilize CSS. Begin by inserting the PDF macro into your Layouts Macro.

Next, select the PDF macro and assign a CSS class, such as "centered-pdf." Then, add custom CSS to your space's stylesheet or inline, leveraging flexbox to center the PDF. This approach is straightforward, effective, and eliminates the need for additional elements like tables

css

.centered-pdf {

    display: flex;

    justify-content: center;

}

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events