How to vertically align text and inline images in quarto reveal.js #13830
Answered
by
mcanouil
handerson1332
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
mcanouil
Dec 25, 2025
Replies: 1 comment 3 replies
-
|
In the future, make sure your example is reproducible, using the palceholder shortcode or using online image. (without a valid image, the margin is not showing) ---
title: "Untitled"
format: html
---
## Title
{width="100"} Text Text
Set it globally: https://quarto.org/docs/output-formats/html-basics.html#includes ---
title: "Untitled"
format:
revealjs:
include-in-header:
- text: |
<style>
.reveal p img {
margin: 0;
}
</style>
---
## Title
{width="100"} Text Text |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Reveal.js does not use Bootstrap and has its own CSS.
HTML formats uses Bootstrap by default.
For some features, Quarto adds some CSS rules such as the rules for call-outs.
You asked for a way to set you styling preferences globally and not on each inline images. I provided you with that. Adapt the rule to your own liking (e.g.,
vertical-align: middle;).More generally, I suggest to read the documentation on theming:
When adding screenshots, please be mindful of all users by adding alternative text.
This comment is about all your screenshots (original post and comment).
I…