代码之家  ›  专栏  ›  技术社区  ›  SJB

在滑动条下方添加有光泽的彩色线条

  •  1
  • SJB  · 技术社区  · 6 年前

    我需要在滑杆下面加一条彩色线。请帮我解决这个问题。请检查图片以便进一步澄清

    请检查我的密码,

    library(shiny)    
    shinyApp(
      ui <- fluidPage(
        tags$style(type = "text/css", 
                   ".irs-grid-text:nth-child(-2n+12) {color: #006400; font: bold;font-size: 12px;}",
                   ".irs-grid-text:nth-child(2n+14) {color: #3CB371; font: bold;font-size: 12px;}",
                   ".irs-grid-text:nth-child(2n+24) {color: orange; font: bold;font-size: 12px;}",
                   ".irs-grid-text:nth-child(2n+36) {color: red; font: bold;font-size: 12px;}",
                   ".irs-grid-pol:nth-of-type(-n+10) {background: #006400; font: bold;}",
                   ".irs-grid-pol:nth-of-type(n+11) {background: #3CB371; font: bold;}",
                   ".irs-grid-pol:nth-of-type(n+23) {background:orange; font: bold;}",
                   ".irs-grid-pol:nth-of-type(n+34) {background:red; font: bold;}"),
        sliderInput("bins", "Number of bins:", 1, 10, 1)
      ),
      server <- function(input, output) {})
    

    image

    1 回复  |  直到 6 年前
        1
  •  0
  •   SeGa    6 年前

    也许是这样?

    library(shiny)
    library(shinydashboard)
    
    ui <- dashboardPage(skin = "black",
                        dashboardHeader(title = "test"),
                        dashboardSidebar(
                          sidebarMenu(
                            menuItem("Complete", tabName = "comp"))),
                        dashboardBody(
                          inlineCSS(".form-group {margin-bottom: 0;}
                                    .irs-with-grid {bottom: -30px;}
                                    .irs-grid {height: 13px;}
                                    .irs-grid-text {height: 0px;}
                                    "
                          ),
                          tabItems(
                            tabItem(tabName = "comp",
                                    fluidRow(
                                      sliderInput("range_var", "", value = 1, min = 1, max = 10, width = '100%'),
                                      div(id="belowslider", style= "display:inline-block; width: 59%; background-color: green;", p()),
                                      div(id="belowslider1", style= "display:inline-block; width: 40%; background-color: orange;", p())          
                                      )))))
    
    server <- function(input, output, session) { 
    }
    
    shinyApp(ui, server)