r - 如何在闪亮的应用程序中设置下载按钮的样式
问题描述
我download button
在我的Shiny
应用程序中创建了一个。但是,我不想在单击时更改背景颜色,这不会发生在这里。下面是我的应用程序 -
library(shiny)
library(shinydashboard)
ui <- shinyUI( dashboardPage(
dashboardHeader(
title="Styling Download Button"
),
dashboardSidebar(
tags$style(type="text/css", "#download1 {background-color:rgba(0,0,0,0);color: black;font-family: Courier New}"),
downloadButton("download1", label="Download with style", class = "butt1")
),
dashboardBody()
))
#server.r
server <- shinyServer(function(input, output) {})
shinyApp(ui, server)
关于如何在点击时保持背景颜色完全相同的任何想法都将非常有帮助。
谢谢,
解决方案
您可以确保#download1:active
(单击时)样式等于#download1
(正常)样式,如下所示。
在下面的示例中,我还确保它border-color
是固定的,因此任何点击效果都不可见。
library(shiny)
library(shinydashboard)
ui <- shinyUI( dashboardPage(
dashboardHeader(
title="Styling Download Button"
),
dashboardSidebar(
tags$style(type="text/css",
"#download1, #download1:active {
background-color:rgba(0,0,0,0);
color: black;
font-family: Courier New;
border-color: #ddd;
-webkit-box-shadow: 0px;
box-shadow: 0px;
}
"),
downloadButton("download1", label="Download with style", class = "butt1")
),
dashboardBody()
))
#server.r
server <- shinyServer(function(input, output) {})
shinyApp(ui, server)
推荐阅读
- azure - Azure IoT Central 连接真实设备。(连接字符串问题)
- java - 如何放心地将数组插入JSONArray
- kubernetes - Confluent Schema Registry Kubernetes 挂起
- tfs - 如何从私有 azure devops 提要中恢复 nuget 包?
- amazon-web-services - CodeDeploy 失败并显示消息“PKCS7 签名消息的验证失败”
- javascript - javascript拦截来自网络工作者的http获取+文件url
- django - 以编程方式序列化 Wagtail 页面
- nginx - 无法使用 Nginx-ingress 在 Kubernetes 中升级 websocket 连接
- mongodb - 我是否应该在 MongoDB 中将子文档拆分为单独的集合?
- java - D&D 角色统计滚轮 (Java)