1

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

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

任何想法?

4

1 回答 1

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"))
)

但是,如果您要自定义 sidebarPanel 本身,请检查

R 闪亮 - 侧边栏面板的背景

于 2016-07-27T06:05:42.137 回答