代码之家  ›  专栏  ›  技术社区  ›  PaulS

在rmarkdown中将背景色从blockquote更改为blockquote

  •  0
  • PaulS  · 技术社区  · 4 年前

    采取以下措施 rmarkdown 文件我想要每个 blockquote 使用不同的背景色渲染(第一种为黄色,第二种为白色),但第二种为 css 块似乎中和了第一个。

    谁能帮帮我吗?

    ---
    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
    
    0 回复  |  直到 4 年前
        1
  •  2
  •   manro    4 年前

    尝试以下解决方案:

    <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