小编Kri*_*a M的帖子

使用 CSS 使仪表板框标题加粗

我正在将 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)
Run Code Online (Sandbox Code Playgroud)

下面是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;
}
Run Code Online (Sandbox Code Playgroud)

问题出在 .box-header 部分。框改变背景颜色和文本颜色;但不是字体大小和字体粗细。

有什么建议?

html css r shiny shinydashboard

3
推荐指数
1
解决办法
3067
查看次数

标签 统计

css ×1

html ×1

r ×1

shiny ×1

shinydashboard ×1