2017-04-14 1 views
1

Ich erreiche, um die Hintergrundfarbe der Navbar mit CSS-Stil, aber nicht die Farbe des Textes zu ändern ... Ich reproduzieren ein grundlegendes Beispiel unten zu meinem Code.R Shiny - Farbe des Textes in navbarPage ändern

ui <- function(){ 

    bootstrapPage('', 

     navbarPage(title = 'Hello'), 

     tags$style(type = 'text/css', '.navbar { background-color: #262626; 
               font-family: Arial; 
               font-size: 13px; 
               color: #FF0000; }', 

           '.navbar-dropdown { background-color: #262626; 
                font-family: Arial; 
                font-size: 13px; 
                color: #FF0000; }')) 

} 

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


shinyApp(ui = ui, server = server) 

Antwort

0

Nun, Sie müssen nur die Farbe auf diesem CSS ändern.

'.navbar-default .navbar-brand { 
         color: #cc3f3f;}' 

Hier bin ich auf # cc3f3f einen roten Text zu erhalten.

ui <- function(){ 

    bootstrapPage('', 

       navbarPage(title = 'Hello'), 

       tags$style(type = 'text/css', '.navbar { background-color: #262626; 
          font-family: Arial; 
          font-size: 13px; 
          color: #FF0000; }', 

          '.navbar-dropdown { background-color: #262626; 
          font-family: Arial; 
          font-size: 13px; 
          color: #FF0000; }', 

          '.navbar-default .navbar-brand { 
          color: #cc3f3f; 
          }' 

          )) 

} 

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


shinyApp(ui = ui, server = server) 
+0

Dank Adelmo, aber Sie beantworten mein Problem nicht. Ich möchte die Farbe der Schriftart in der Navigationsleiste (d. H. "Farbe: # FF0000") ändern, nicht die Hintergrundfarbe. – marnau901e

+0

Sorry, ich missverstanden, ich habe die Antwort bearbeitet. –

Verwandte Themen