[英]Change background color of two div inside one div R Shiny
我想换一个背景颜色div
有两个div
的内部。
我在用户界面中写道:
div(
div(fileInput(inputId = "file1",
label = "File 1"),
style="min-width:200px;max-width:45%; float:left; margin-right:2.5%;"),
div(fileInput(inputId = "file21",
label = "File 2,1"),
fileInput(inputId = "file22",
label = "File 2,2"),
style="min-width:200px;max-width:45%; float:left;"),
style = "width: 100%; background-color:#ADD8E6;"),
但颜色不会改变。 当我将背景颜色更改为每个单独的div
它确实有效。 但它看起来并不好看。 这就是为什么我想在更大的div
更改背景颜色。
任何的想法?
也许他们实现这一目标的另一种方式。
要么你需要给父容器 div 一个height
要么你fluidRow
包含它的fluidPage
/ fluidRow
样式:
library(shiny)
ui <- fluidPage(
div(
div(fileInput(inputId = "file1",
label = "File 1"),
style="min-width:200px;max-width:45%; float:left; margin-right:2.5%;"),
div(fileInput(inputId = "file21",
label = "File 2,1"),
fileInput(inputId = "file22",
label = "File 2,2"),
style="min-width:200px;max-width:45%; float:left;"),
# style = "width: 100%; background-color:#ADD8E6;") # height: 500px;
),
style = "width: 100%; background-color:#ADD8E6;"
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.