R Shiny - change color of text in navbarPage

前端 未结 1 342
小蘑菇
小蘑菇 2021-01-13 03:28

I achieve to change the background color of the navbar using css style but not the color of the text... I reproduce a basic example below to my code.

ui <         


        
相关标签:
1条回答
  • 2021-01-13 04:10

    Well, You just need to change the color on this css.

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

    Here, I changed to #cc3f3f to obtain a red text.

       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 讨论(0)
提交回复
热议问题