4

I have a quarto file with an HTML rendering, and I want to change the size and color of the title, how should I proceed? Minimal example:

---
title: "Cars"
format: 
  html
---

## MTCars
```{r}
head(mtcars)
```
Maël
  • 45,206
  • 3
  • 29
  • 67
  • 1
    This could also help: [question](https://stackoverflow.com/questions/73546631/how-to-format-tabset-font-in-quarto/73546972#73546972) – Quinten Sep 01 '22 at 15:57

1 Answers1

7

You can use css directly in your code; specify .title to apply your changes to the title only.

With font-size, you can change the size of the title, and with color you can change the color. You can also change the style with font-style, the family (e.g. Arial) with font-family, and the variant with font-variant.

---
title: "Cars"
format: 
  html
---

```{css, echo=FALSE}
.title {
  font-size: 100px;
  font-style: italic;
  color: blue;
  font-family: Arial;
  font-variant: small-caps;
}
```

## MTCars
```{r}
head(mtcars)
```

enter image description here

Maël
  • 45,206
  • 3
  • 29
  • 67