繁体   English   中英

交换 label 的 position 和 checkboxInput() shiny 中的复选框

[英]Interchange the position of label and check-box in checkboxInput() shiny

在 checkboxInput() 中,复选框默认出现在 label 参数中给出的文本之前。 我试图将复选框移到左侧,将 label 移到右侧。 是否有任何 CSS 参数来交换位置也指定 label 和复选框之间的特定间隙?

这主要取自这里

library(shiny)

ui <- fluidPage(
  tags$style("
             .cbcontainer {
               display: inline-block;
             }
             
             .checkbox {
               text-align: right;
               display: inline-block;
             }
             
             .checkbox input {
               float: right;
               position: relative !important;
               margin: 5px !important;
             }
             
             .checkbox label {
               padding-left: 0px !important;
             }
             "),
  div(checkboxInput("My checkbox", label = "mycheckbox"), class = "cbcontainer")
)

server <- function(input, output, session) {}

shinyApp(ui, server)

为了更好地理解 css 部分,另请参阅

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM