R 如何更改面板颜色?

R 如何更改面板颜色?,r,shiny,R,Shiny,如何更改面板的面板颜色?如下图所示,我可以通过如下所示的css代码更改背景颜色,但我无法更改如图所示的面板 我可以改变背景色。但是我不能改变面板的颜色 以下代码是可复制的示例。 我应该添加什么css代码来更改面板的颜色 library(shiny) # Define UI for application that draws a histogram ui <- fluidPage( shiny::tags$head( # s

如何更改面板的面板颜色?如下图所示,我可以通过如下所示的css代码更改背景颜色,但我无法更改如图所示的面板

我可以改变背景色。但是我不能改变面板的颜色

以下代码是可复制的示例。 我应该添加什么css代码来更改面板的颜色

   library(shiny)

    # Define UI for application that draws a histogram
    ui <- fluidPage(
        shiny::tags$head(
            # shinythemes::themeSelector()

                              shiny::tags$style(shiny::HTML("


            h1{
              font-size: 35px;
              font-weight: bold;
              font-family: Arial-Black;

              color: #800000            ;

            }

            h2 {
              font-size: 33px;
              font-weight: bold;
              font-family: ACalibri;

              color: #800000            ;

            }

            h3 {
              font-size: 30px;
              font-weight: bold;
              font-family: Calibri;

              color: #800000            ;

            }

            h4 {
              font-size: 27px;
              font-weight: bold;
              font-family: Calibri;

              color: #800000            ;

            }



            h5 {
              font-size: 24px;
              font-weight: bold;
              font-family: Calibri;

              color: #800000            ;

            }



            h6 {
              font-size: 15px;
              font-weight: bold;
              font-family: Arial-Black;

              color: #800000            ;

            }



            img {
                border:0;
            }


            body {
              font-size: 18px;
                 font-weight:bolder;

              font-family: Calibri;


              color: #800000            ;
             font-color: #888889;

             background-color: #222222;



            }


                                           .skin-blue .main-header .logo {
                                            background-color: #f4b943;
                                            }









            p {
                color: #440000      ;
            }




                "))

        ),#taghead
        # Application title
        titlePanel("Old Faithful Geyser Data"),

        # Sidebar with a slider input for number of bins 
        sidebarLayout(
            sidebarPanel(
                sliderInput("bins",
                            "Number of bins:",
                            min = 1,
                            max = 50,
                            value = 30)
            ),

            # Show a plot of the generated distribution
            mainPanel(
               plotOutput("distPlot")
            )
        )
    )

    # Define server logic required to draw a histogram
    server <- function(input, output) {

        output$distPlot <- renderPlot({
            # generate bins based on input$bins from ui.R
            x    <- faithful[, 2]
            bins <- seq(min(x), max(x), length.out = input$bins + 1)

            # draw the histogram with the specified number of bins
            hist(x, breaks = bins, col = 'darkgray', border = 'white')
        })
    }

    # Run the application 
    shinyApp(ui = ui, server = server)
库(闪亮)
#为绘制直方图的应用程序定义UI

ui如果要更改整个
侧边栏面板的颜色,可以直接在R代码中执行此操作:

侧栏面板(
style=“背景色:红色;”,
滑音输入(
“垃圾箱”,
“垃圾箱数量:”,
最小值=1,
最大值=50,
值=30
)
)
此外,您还可以在css代码段中添加以下段落:

。嗯{
背景色:红色;
}

谢谢。有没有显示这种css代码的网页?你为什么知道这些代码?不管怎样,谢谢你的回复。不客气<代码>井
是闪亮的
侧边栏面板
的类别,而不是代码。你可以用css中的点来调用它。只要学习css的基本知识,这对我来说是新的,谢谢你让我知道:)