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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.