In revelajs, how to align h2 when the text has a padding and a backgorund color (like a text-box) #5692
-
When I use the h2 with background color (like a text box) and use de css display: inline, the "text-box" autoamtically justify to the left. How can I keep everything centered, the text and the "text-box". .reveal section h2 { |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Please could you format your post? Also, could you share a small "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks. You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```
The end.
```` |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Because of the various
display: block
, either you learn to tweedle with CSS until your figure out the proper cascade (not 100 % sure it's actually possible here, since I believe you want the background to only appear under the text).