Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Center slide header in middle of revealjs Quarto

I would like to center a slides header in the middle of the slide. It should actually look the same as in the title slide. I tried using {.center}, but that only centers vertically and not horizontally. Here is some reproducible code:

---
title: "Center slide in middle"
format: revealjs
---

## Slide {.center}

Output:

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

As you can see it is vertically centered but not horizontally. So I was wondering if anyone knows how to center the slide header in the middle of a slide in revealjs Quarto?

>Solution :

---
title: "Center slide in middle"
format: revealjs
engine: knitr
---


## Slide {.center}

```{css}
.center h2 {
  text-align: center;
}
```

slide header centered

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading