使用 CSS 将仪表板框标题设为粗体
Make dashboard box title bold using CSS
我正在为 R shiny 应用程序使用 R Shiny 仪表板。我已经包含 css 文件来设置应用程序的样式。我需要将框标题更改为粗体。下面是 ui.R
的最小示例
library(shiny)
library(shinydashboard)
body <-
dashboardBody(tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "my_style.css")
),
tabItems(tabItem(tabName = "test",
fluidRow(
box(
collapsible = TRUE,
width = 3,
status = "primary",
solidHeader = T,
title = "Test"
)
))))
dashboardPage(dashboardHeader(), dashboardSidebar(), body)
下面是 my_style.css
文件
.box.box-solid.box-primary>.box-header{
background: rgb(0, 129, 201);
color: #ffffff;
font-size: 18px;
font-weight; bold;
}
.box.box-solid.box-primary{
font-family: OpenSans;
font-size: 16px;
text-align: left;
color: #000000;
}
问题出在 .box-header 部分。该框更改背景颜色和文本颜色;但不是 font-size 和 font-weight。
有什么建议吗?
怎么样:
.box-header h3 {
font-weight: bold;
}
对于任何想要增加字体大小的人,您将需要一个额外的参数(或者至少我需要):
.box-header h3.box-title {
font-weight: bold;
font-size: 24px;
}
我正在为 R shiny 应用程序使用 R Shiny 仪表板。我已经包含 css 文件来设置应用程序的样式。我需要将框标题更改为粗体。下面是 ui.R
library(shiny)
library(shinydashboard)
body <-
dashboardBody(tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "my_style.css")
),
tabItems(tabItem(tabName = "test",
fluidRow(
box(
collapsible = TRUE,
width = 3,
status = "primary",
solidHeader = T,
title = "Test"
)
))))
dashboardPage(dashboardHeader(), dashboardSidebar(), body)
下面是 my_style.css
文件
.box.box-solid.box-primary>.box-header{
background: rgb(0, 129, 201);
color: #ffffff;
font-size: 18px;
font-weight; bold;
}
.box.box-solid.box-primary{
font-family: OpenSans;
font-size: 16px;
text-align: left;
color: #000000;
}
问题出在 .box-header 部分。该框更改背景颜色和文本颜色;但不是 font-size 和 font-weight。
有什么建议吗?
怎么样:
.box-header h3 {
font-weight: bold;
}
对于任何想要增加字体大小的人,您将需要一个额外的参数(或者至少我需要):
.box-header h3.box-title {
font-weight: bold;
font-size: 24px;
}