我想让信息框中的文本小于仪表板其余部分的文本。这是代码的dashboardBody部分:
dashboardBody(fluidRow(
box(
title = "Box 1",
width = 12, solidHeader = TRUE,
status = "primary",
uiOutput("myUiOutput")
),
box(
title = "Box 2",
width = 12,
solidHeader = TRUE,
status = "warning",
plotOutput("myPlot")
),
infoBox(title = "my info box title",
value = "my info box message",
subtitle = NULL,
icon = shiny::icon("copyright"), color = "black", width = 12,
href = NULL, fill = FALSE)
)) #<-end dashboardBody
Run Code Online (Sandbox Code Playgroud)
我尝试在 Box 1 代码之前添加此标签,但它不起作用:
tags$head(tags$style(HTML('
.info-box .logo {
font-family: "Georgia", Times, "Times New Roman", serif;
font-weight: bold;
font-size: 8px;
}
'))),
Run Code Online (Sandbox Code Playgroud)
另一种解决方案是font-size在您事先不知道当前px尺寸是多少的情况下设置为百分比,例如
value = tags$p("my info box message", style = "font-size: 50%;")
Run Code Online (Sandbox Code Playgroud)