我有一个闪亮的应用程序,我想更改导航栏菜单的字体类型和背景颜色。
运行该应用程序后,我在此上使用了“检查”,发现该元素是:
a href="#" class="dropdown-toggle" data-toggle="dropdown" data-value="More">
More
<b class="caret"></b>
</a>
但我不熟悉CSS。
ui <- function(){
bootstrapPage('',
navbarPage(title = 'Hello colour changed',
navbarMenu("More",
tabPanel("Table"
),
tabPanel("About"
)
)),
tags$style(type = 'text/css', '.navbar { background-color: #252525;
font-family: Arial;
font-size: 13px;
color: #FF0000; }',
'.navbar-dropdown { background-color: #252525;
font-family: Arial;
font-size: 13px;
color: #FF0000; }',
'.navbar-default .navbar-brand {
color: #cc3f3e;
}'
))
}
server <- function(input, output, session){
}
shinyApp(ui = ui, server = server)
下面将更改导航栏的背景颜色,文本颜色,您还可以设置font-family
来更改字体类型。
library(shiny)
library(shinydashboard)
ui <- function(){
navbarPage(title = 'Hello colour change',
tabPanel("title2"),
tabPanel("title3"),
tags$style(type = 'text/css',
'.navbar { background-color: red;}',
'.navbar-default .navbar-brand{color: white;}',
'.tab-panel{ background-color: red; color: white}'
))
}
server <- function(input, output, session){
}
shinyApp(ui = ui, server = server)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句