css - Change background color of selectInput in R Shiny -


my example code:

library(shiny)  server <- function(input, output) { }  ui <- fluidpage(   br(),   selectinput("select1", "choose: ", c("alt1.1", "alt1.2"), selected = c("alt1.1"), selectize = false, multiple = true),   br(),   selectinput("select2", "choose: ", c("alt2.1", "alt2.2"), selected = c("alt2.1"), selectize = false, multiple = true) )  shinyapp(ui = ui, server = server) 

how have change code background color of widgets red select1 , blue select2?

edit:

i tried this:

div(selectinput("select1", "choose: ", c("alt1.1", "alt1.2"), selected = c("alt1.1"), selectize = false, multiple = true), style = "background-color: red") 

enter image description here

but not looking for! instead want background of options red!

edited requested in comments below

you can add css through style tags follows:

library(shiny)  server <- function(input, output) { }  ui <- fluidpage(   br(),   tags$style("#select1 {border: 2px solid #dd4b39;}"),   selectinput("select1", "choose: ", c("alt1.1", "alt1.2"), selected = c("alt1.1"), selectize = false, multiple = true),   br(),   tags$style("#select2 {background-color:blue;}"),   selectinput("select2", "choose: ", c("alt2.1", "alt2.2"), selected = c("alt2.1"), selectize = false, multiple = true) )  shinyapp(ui = ui, server = server) 

enter image description here


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -