【问题标题】:R Markdown change backround color of sections in CSSR Markdown更改CSS中部分的背景颜色
【发布时间】:2018-01-15 19:45:46
【问题描述】:

我想知道是否可以使用 css 更改基于 rmarkdown 的 flexdashboard 的背景颜色。

特别是,我有一个这样的文档结构:

---
  title: "Test"
output: 
  flexdashboard::flex_dashboard:
  vertical_layout: scroll
logo: logo.jpg
self_contained: no
---
  Overview {data-orientation=rows data-icon="ion-ios-home"}
=====================================  

  Row
-------------------------------------
  ### Plot 1

  ### Plot 2

  Row
-------------------------------------

  ### Plot 3

  ### Plot 4

我想要做的是更改由行布局分隔的部分的背景颜色。

例如,一个部分是灰色的,下面一个是白色的。

这可能吗,如果可以,有什么提示我该怎么做吗?

【问题讨论】:

标签: html css r knitr r-markdown


【解决方案1】:

当然可以。可以使用 colored 之类的类或检查页面源代码中各部分的 id(rowrow-1、...)并在 CSS 样式中使用它们。

---
title: "Test"
output: 
  flexdashboard::flex_dashboard:
  vertical_layout: scroll
self_contained: no
---
  Overview {data-orientation=rows data-icon="ion-ios-home"}
=====================================  

<style>
.colored {
  background-color: #DDDDDD;
}
</style>

  Row { .colored }
-------------------------------------

  ### Plot 1

  ### Plot 2

  Row
-------------------------------------

  ### Plot 3

  ### Plot 4

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-11-29
    • 2021-06-30
    • 1970-01-01
    • 2019-06-20
    • 1970-01-01
    • 2013-01-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多