r - 在 Shiny App 中增加条带/条带的大小
问题描述
你能帮我增加我在下面的应用程序中制作的条带/乐队的大小吗?我插入一个图来说明我的想法。这个想法是我增加范围直到我制作的水平线。并且标题“项目描述”位于这个新范围内。
太感谢了!
library(shiny)
library(shinythemes)
ui <- shiny::navbarPage(theme = shinytheme("flatly"),
title="Test", collapsible = TRUE,
tabPanel("",
div(
style =
"height: 80px; background-color: #02BE7F; width: 100%; position: absolute; right:0;",
h2(HTML("Project <b>Description</b>"),
style="text-align:center;color: white"),
hr(),
div(
style = "width: 70%; margin: auto;",
h2(HTML("Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"),
style="text-align:justify"))
)
))
server <- function(input, output,session) {
}
shinyApp(ui = ui, server = server)
解决方案
library(shiny)
library(shinythemes)
ui <- shiny::navbarPage(theme = shinytheme("flatly"),
title="Test", collapsible = TRUE,
tabPanel("",
div(
div(
style =
"height: 40vh;
background-color: #02BE7F;
width: 100%;
right: 0;
position: relative;",
h2(HTML("Project <b>Description</b>"),
style=
"color: white;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%);"),
hr(style = "bottom: 0.1px;
position: absolute;
width: 100%;"),
),
div(
style = "width: 70%; margin: auto;",
h2(HTML("Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"),
style="text-align:justify"))
)
))
server <- function(input, output,session) {
}
shinyApp(ui = ui, server = server)
推荐阅读
- java - 将循环重写为单行循环
- kubernetes - 如何在一组自动缩放 Pod 上创建 Kubernetes RBAC 策略(或者甚至可能)?
- javascript - 如何在javascript中使用ejs将字符串转换为html格式
- graphql - KeystoneJS 'resolveInput' 字段挂钩:从字段挂钩返回 'resolvedData' 会产生 GraphQL 转换错误
- excel - 是否可以获得活动单元格所在范围的名称?
- javascript - 如何从 Node.js Outlook 加载项中的 Outlook 邮件中获取附件内容?
- javascript - DOM 事件和 sencha 事件之间的事件顺序
- flutter - 收到此错误: BoxConstraints(0.0<=w<=Infinity, h=Infinity),但我有 Container( 高度:88,宽度:375,
- java - Java Google guava multimap:获取所有列表条目
- reactjs - 在使用带有父组件和 react.js/typescript 的基本组件的组合时面临问题