首页 > 解决方案 > 从 ShinyWidgets 更改 AwesomeCheckbox 的边距间距

问题描述

我需要在 Shiny 项目中更改 awesomeCheckbox() 输入项的顶部和底部间距,因为我有很多是垂直放置的,而且它们之间的空白太多。

在我的浏览器上使用检查元素我可以看到我需要将类的元素"checkboxbs checkbox-bs checkbox-bs-primary"从更改style="margin-top: 10px; margin-bottom: 10px;"style="margin-top: 0px; margin-bottom: 0px;"

我尝试使用以下类更改 CSS,但无济于事:

tags$head(tags$style("
  .checkbox {display: inline-block; margin-top: 0px; margin-bottom: 0px; !important}
  .col-sm-4 {display: inline-block; margin-top: 0px; margin-bottom: 0px; !important}
  .checkboxbs {display: inline-block; margin-top: -20px; margin-bottom: 0px; !important}
  .checkbox-bs.input {margin-top: 0px; margin-bottom: 0px; !important}
  .checkbox-bs {margin-top: 0px; margin-bottom: 0px; top:0px; bottom:0px; !important}
  .checkbox-bs-primary {margin-top: 0px; margin-bottom: 0px; top:0; bottom:0px; !important}
  .checkboxbs.checkbox-bs.checkbox-bs-primary {margin-top: 0px; margin-bottom: 0px;}
  .form-group {margin-top: 0px; margin-bottom: 0px;}
  .shiny-input-container {margin-top: 0px; margin-bottom: 0px; !important}
  .form-group.shiny-input-container {margin-top: 0px; margin-bottom: 0px; !important}
  .shiny-bound-input {margin-top: 0px; margin-bottom: 0px; !important}
  ")),

标签: cssrshinyshinywidgets

解决方案


推荐阅读