I have created an R Shiny app and I would like to change the background color of tabPanel when it is active or when I hover over. I am not sure that I use define the correct properties in the css file.
enter image description here
Below you can find the code that i use:
library(shiny)
library(shinydashboard)
ui <- function(){
navbarPage(title = 'Hello',
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}',
'.nav navbar-nav li.active:hover a, .nav navbar-nav li.active a {
background-color: green ;
border-color: green;
}'
))
}
server <- function(input, output, session){
}
shinyApp(ui = ui, server = server)
I would greatly appreciate your help on this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…