【问题标题】:Changing menu icon in shiny dashboard更改闪亮仪表板中的菜单图标
【发布时间】:2017-02-23 13:27:54
【问题描述】:

以下 css 样式对应于闪亮仪表板中的菜单图标。我想改变它。我尝试在体内使用tags$head(tags$style..,但它没有用。有什么想法吗?

.main-header .sidebar-toggle:before {
    content: "\f0c9";
}

【问题讨论】:

    标签: css r shiny shinydashboard


    【解决方案1】:

    你需要转义\:

    ui <- dashboardPage(
      dashboardHeader(),
      dashboardSidebar(),
      dashboardBody(
        tags$head(tags$style(HTML('
          .main-header .sidebar-toggle:before {
            content: "\\f0c7";}')))
        )
    )
    
    server <- function(input, output) { }
    
    shinyApp(ui, server)
    

    我通常也将 CSS 包裹在 HTML 中以防止其他 HTML 字符转义。

    【讨论】:

    • 这看起来很不错,但我需要用图像替换菜单图标,比​​如mylogo.png。如何做到这一点?
    猜你喜欢
    • 1970-01-01
    • 2017-04-12
    • 2016-12-09
    • 1970-01-01
    • 2017-12-14
    • 2015-04-22
    • 1970-01-01
    • 1970-01-01
    • 2019-02-23
    相关资源
    最近更新 更多