Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change title banner size in Quarto?

I have the below qmd file with quarto html option title-block-banner: true. How do I modify the size of the banner to reduce width?

---
title: "Cars"
title-block-banner: true
format: 
  html:
    code-fold: true
    page-layout: full
    fig_caption: yes
---
::: panel-tabset 
## MTCars

```{r}
head(mtcars)

```
## Cars

```{r}
head(cars)

```
:::
like image 248
apprunner2186 Avatar asked Oct 16 '25 13:10

apprunner2186


1 Answers

You can do it in this way by modifying the default style:

Qmd-file:

---
title: "Cars"
title-block-banner: true
format: 
  html:
    code-fold: true
    page-layout: full
    fig_caption: yes
---

<style>

#title-block-header {
  margin-block-end: 1rem;
  position: relative;
  margin-top: -1px;
  height: 75px;
}

.quarto-title-banner {
  margin-block-end: 1rem;
  position: relative;
  margin-top: -30px;
  height: 85%;
}

</style>

::: panel-tabset 
## MTCars

```{r}
head(mtcars)

```
## Cars

```{r}
head(cars)

```
:::

Output:

enter image description here

like image 191
manro Avatar answered Oct 18 '25 05:10

manro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!