html - 如何在闪亮的应用程序中包含 html/css
问题描述
下面是闪亮的应用程序,如果我需要在其中添加一些 CSS(附在下面),我可以在哪里添加它以便它在 r 闪亮的应用程序中呈现
css
<style>
.bs-example{
margin: 60px;
}
</style>
用户界面
library(shiny)
shinyUI(fluidPage(
titlePanel("Stateful"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
),
# Show a plot of the generated distribution
mainPanel(
tabsetPanel(
id="inTabset",
tabPanel("Tab 1",actionButton("switch_tab", "Go to the third tab")),
tabPanel("Tab 2", "there!"),
tabPanel("Tab 3", "there!"))
)
)
))
服务器.R
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
})
解决方案
您可以在 ui 部分添加您的 CSS 文件,如下所示:
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
)
请记住,您的 CSS 文件应该位于闪亮应用程序的 www 目录中。
推荐阅读
- python - 无法使用 PyMongo 将 MongoDB 与 Django 连接
- json - 如何将带有文本的图像编码为属性字符串
- android - 我可以为所有活动创建一个功能,播放,暂停音乐
- javascript - 我创建了两个函数:“opendoor”和“closedoor”。我试图按顺序调用它们,但只执行了最后一个
- r - 为元数据创建可变长度的样本向量
- mysql - 多次选择最近期货到期的利率 SQL
- dataframe - 当操作限制是行只能循环而不是一次全部时,如何在 Spark Data Frame lineage 上适合顺序操作?
- jsf - 将上下文传递给函数有用吗?
- allure - 只显示一个标签,当我尝试在诱惑报告中添加两个标签时
- automated-tests - 是什么导致了 yarn-error.log,这对我的项目有何影响?