我在Shiny中有一个selectInput
小部件。
我希望分别控制label
参数和小部件本身的输入文本(即choices
和selected
参数的文本)的字体大小。
初始的[没有样式]输出如下:
selectInput(inputId = "inId", label = "Different Font Size...", choices = "...From This")
我尝试使用 div()
,像这样:
div(style = "font-size: 8px",
selectInput(inputId = "inId", label = "Different Font Size...", choices = "...From This")
)
这将同时缩小label
文本和输入文本(即来自choices
的文本)。
Note: this is in contrast to using this
div(style = ...)
approach fortextInput
, which instead only impacts thelabel
text (and not the input text).In this instance, I would then use
tags$style("#inId {font-size:8px;}")
following thetextInput
function to modify the input font size separately.div(style = "font-size: 8px", textInput(inputId = "inId", label = "Different Font Size...", value = "...From This") ), tags$style("#inId {font-size:14px;}")
selectInput()
的情况。
Designating a
tag$style(...)
following adiv(style = ...)
wrapper doesn't seem to do anything to the resulting text style.div(style = "font-size: 8px", selectInput(inputId = "inId", label = "Different Font Size...", choices = "...From This") ), tags$style("#inId {font-size:14px;}") )
那么我该怎么做呢?
如何使用Shiny控制selectInput
小部件中label
和choices
文本的样式(特别是字体大小)?
如果有关系:我正在使用shiny_1.0.3和R版本3.4.0