Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 闪亮-将下拉菜单(选择标记)的大小(填充?)更改为更小_Html_Css_R_Shiny - Fatal编程技术网

Html 闪亮-将下拉菜单(选择标记)的大小(填充?)更改为更小

Html 闪亮-将下拉菜单(选择标记)的大小(填充?)更改为更小,html,css,r,shiny,Html,Css,R,Shiny,如何将下拉菜单(选择标签)的大小更改为更小?我认为是填充物让下拉列表看起来“厚”。因此我将填充改为0,使其“薄”,显然这不起作用 shinyUI(fluidPage( sidebarPanel( # Change the font size. tags$style(type='text/css', " .selectize-input, .selectize-dropdown { padding:0 ; }"), # Species/ pollutant opt

如何将下拉菜单(选择标签)的大小更改为更小?我认为是填充物让下拉列表看起来“厚”。因此我将填充改为0,使其“薄”,显然这不起作用

shinyUI(fluidPage(

  sidebarPanel(

    # Change the font size.
    tags$style(type='text/css', " .selectize-input, .selectize-dropdown { padding:0 ; }"),

    # Species/ pollutant options
    selectInput(
        inputId = "species",
        label = "Species:",
        choices = c(...)
        ),
   ....
结果很尴尬,


有什么想法吗?

对于下拉选项,您需要的是
行高(我认为默认情况下,填充已经为0,请使用chrome调试器查看其上的CSS)

对于长方体本身,看起来引导程序正在其上放置一个
minheight
,因此您还需要添加
minheight:0。再一次,我刚刚通过查看它的CSS,用调试器解决了这个问题

因此,这里有一个可行的解决方案:

runApp(shinyApp(
  ui = fluidPage(
    tags$style(type='text/css', ".selectize-input { padding: 2px; min-height: 0;} .selectize-dropdown { line-height: 10px; }"),
    selectInput("test","Test", 1:5)
  ),
  server = function(input, output, session) {
  }
))

请尝试发布完整的代码示例,而不是我们必须自己完成的代码片段。使我们能够更轻松、更快地回答问题。

没有跨浏览器解决方案来设计大多数表单元素的样式,其中包括
仅使用CSS。感谢您的帮助<代码>请尝试发布完整的代码示例,而不是我们必须自己完成的代码片段。使我们能够更轻松、更快地回答问题
——下次我们会记住这一点。谢谢。提供调试器的屏幕截图将大大增强这个已经正确的答案。