【发布时间】:2016-05-09 19:01:52
【问题描述】:
我正在尝试在dashboardSidebar 中构建一个带有页脚的闪亮仪表板,它粘在视口的底部。为此,我尝试使用here 建议的自定义 CSS 样式(谷歌搜索“页脚底部引导程序”时的众多搜索结果之一):
# create an example for the SO question on sticky footer
library(shiny)
library(shinydashboard)
# sidebar
so_sidebar = dashboardSidebar(
sidebarMenu(
menuItem(
text = "Some text."
)
),
# footer here
tags$footer(
tags$p("Footer message here."),
style = "
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important; /* This line and the next line are not necessary unless you need IE6 support */
height: 100%;
margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
height: 155px; /* .push must be the same height as .footer */
}
/*
Sticky Footer by Ryan Fait
http://ryanfait.com/
*/"
)
)
# compose the dashboard
so_ui = dashboardPage(
header = dashboardHeader(
title = "SO question"
),
sidebar = so_sidebar,
body = dashboardBody()
)
# run the application
shiny::shinyApp(
ui = so_ui,
server = shinyServer(function(input, output) {})
)
由于我以前从未使用过自定义 CSS,因此我不确定我是否正确使用了 CSS。我正在遵循here 的指示。
有人可以帮助获得正确的 CSS,或者对粘在 Shiny Dashboard 侧边栏中可视区域底部的页脚提出任何其他建议吗?
【问题讨论】:
标签: css r shiny shinydashboard