Home > OS >  Changing the background color from blockquote to blockquote in rmarkdown
Changing the background color from blockquote to blockquote in rmarkdown

Time:12-07

Take the following rmarkdown file. I would like to have each blockquote rendered with a different background color (yellow the first one and white the second one), but the second css chunk seems to neutralize the first one.

Could someone please help me?

---
title: "Untitled"
output: html_document
---


```{css echo = FALSE}
blockquote{
background-color: rgb(255,255,153);
}
```

> this is a note 1
>
> the is is still the note


```{css echo = FALSE}
blockquote{
background-color: initial;
}
```

> this is a note 2
>
> the is is still the note

CodePudding user response:

Try this solution:

<div style="background-color:rgba(250, 230, 7, 1);">

> this is a note 1
>
> the is is still the note

</div>


<div style="background-color:rgba(63, 237, 40, 1);">

> this is a note 2
>
> the is is still the note

</div>

enter image description here

  • Related