R Shiny: How do you change the background color of the Header?

感情迁移 提交于 2020-01-02 01:16:07

问题


I am writing a shiny application and I would like to customize the look of the header. I am able to add images and format the text, but what I would like to do is change the background color, but only for the header panel, not the rest of the ui. So far I have this for my

ui.r:

shinyUI(pageWithSidebar(

headerPanel(
list(tags$head(tags$style("body {background-color: black; }")),
"Graphs", HTML('<img src="ah_large_black.gif", height="200px"    
style="float:right"/>','<p style="color:red"> test test </p>' ))
),

This has text of two different colors and puts an image on the right side, but it make the background color of everything black. Is there a way to limit the color this to just the header?


回答1:


Try something like

tags$style(".span12 {background-color: black;}")

instead of

tags$style("body {background-color: black;}")


来源:https://stackoverflow.com/questions/19798048/r-shiny-how-do-you-change-the-background-color-of-the-header

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!