使用CSS使仪表板框标题变为粗体

问题描述 投票:1回答:2

我正在使用R Shiny仪表板作为R闪亮的应用程序。我已经包含了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。

有什么建议?

html css r shiny shinydashboard
2个回答
2
投票

关于什么:

.box-header h3 {
   font-weight: bold;
}

0
投票

对于任何想要增加字体大小的人来说,你需要一个额外的参数(或者至少我做过):

.box-header h3.box-title {
   font-weight: bold;
   font-size: 24px;
}
© www.soinside.com 2019 - 2024. All rights reserved.