2017-08-08 54 views
1

我想知道是否可以使用css更改基于rmarkdown的flexdashboard的背景颜色。R Markdown更改CSS中各节的背景颜色

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

--- 
    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 

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

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

这是可能的,如果是的话,任何提示我怎么能做到这一点?

+0

hello试试这个http://rmarkdown.rstudio.com/flexdashboard/using.html#appearance –

回答

2

当然可以。可以使用类似colored的类或检查页面源代码段中的代码(row,row-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