【问题标题】:Changing font size and color in Shiny R doesn't work?在 Shiny R 中更改字体大小和颜色不起作用?
【发布时间】:2016-11-30 16:08:38
【问题描述】:

我正在尝试使用下面的代码(在 ui.r 中)更改 ID:test_type 的侧边栏面板的字体大小和颜色,但它不起作用?

tags$head(tags$style("#test_type{color: red; font-size: 20px; font-style: italic; }" ) )

有什么想法吗?

【问题讨论】:

  • sidebarPanel 没有 id 参数。你还有别的意思吗?

标签: shiny shiny-server shinydashboard shinyjs


【解决方案1】:

我假设您想更改 ui 中输入字段元素的颜色和字体。你可以这样做:

sidebarPanel(
    tags$head(tags$style(type="text/css", 
              ".test_type {color: red;
                           font-size: 20px; 
                           font-style: italic;}"
                        )
             ),
    div(class="test_type",
       textInput(inputId="ti1", label="Text Input 1", value = "test"))
)

但如果您想自定义侧边栏面板本身,请检查

R shiny - background of sidebar panel

【讨论】:

    猜你喜欢
    • 2018-01-23
    • 2018-09-07
    • 1970-01-01
    • 1970-01-01
    • 2018-06-05
    • 1970-01-01
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多