Adding background color to title in navbarPage() function

Is this even possible? I've tried linking CSS and doing in text CSS but it's not working. I'm a pretty novice R Shiny coder. Any help would be seriously appreciated! Thanks y'all

Do you want a background color on the text of the title like this?

library(shiny)

ui <- navbarPage(title = span( "My Title", style = "background-color: #DEEBF7" )

)
  
server <- function(input, output) {
  
}

shinyApp(ui = ui, server = server)

omg thank you so much that worked. I was trying "backgroundColor" for the longest time lmao. Do you know of any ways to make the background color bigger? Right now the dimensions seem to just be the edge of the letters. Thank you!!!!!

and if you could tell me how to add text color and background color simultaneously, that would be amazing. This is what i have:

library(shiny)

ui <- navbarPage(title = span( "My Title", style = "background-color: #DEEBF7", style="color:red" )

)
  
server <- function(input, output) {
  
}

shinyApp(ui = ui, server = server)

@elphlord You change the text color and background color simultaneously by slightly changing your code to this:

library(shiny)

ui <- navbarPage(title = span( "My Title", style = "background-color: #DEEBF7; color: red")

)

server <- function(input, output) {

}

shinyApp(ui = ui, server = server)

However, I'm not sure on how to make the background color bigger!

No worries, you've helped me enough already! Thanks

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.