如何在Shiny App(R)中向SideBarPanel添加css标签

Cyb*_*tic 3 r shiny

我想在我的闪亮应用程序中更改我的页面上sideBarPanels的背景颜色....但是......仅在一个特定页面上.所以我在考虑使用CSS标签,但我不确定如何做到这一点.

我试过这个:

sidebarPanel(class="set1",   
htmlOutput("vizTest")
)
Run Code Online (Sandbox Code Playgroud)

然后尝试引用CSS文件中的类:

#set1 form.well { 
background: transparent;
border: 0px;
}
Run Code Online (Sandbox Code Playgroud)

Cyb*_*tic 5

所以诀窍是将sidebarPanel包装在div中,然后为div设置类.然后可以使用'.'以通常的方式引用它.字首:

ui.R

div(class="set1",
sidebarPanel(

#content of panel here

))
Run Code Online (Sandbox Code Playgroud)

css文件

.set1 form.well { 
background: transparent;
border: 0px;
}
Run Code Online (Sandbox Code Playgroud)