r - 从 shinyWidgets 更改下拉按钮的 css 参数
问题描述
我从 shinyWidgets 包中设计了一个简单的下拉按钮。不知何故,我无法更改小部件的 css 参数。
dropdownButton( icon = icon('info'), size = 'sm', right = T, up = F, width = '400px',
div('my text', style = 'font-size:10px'))
我已经尝试按照这里shinywidget dropdownButton CSS标签的链接的css调整
然而,这只改变了弹出窗口的参数。
我试图检查元素并找到 css 代码但徒劳无功。
理想情况下,我需要更改按钮的大小、背景颜色和不透明度。
谢谢
解决方案
希望这会有所帮助,参考这个 SO 链接#1,'status' 参数可以让你设置自定义类(见这个)。在 tags$style 中,您可以使用 'background-color' 选择背景颜色,使用 'opacity' 选择不透明度。'size' 参数允许您选择按钮的大小。
dropdownButton(status = "dropdownbutton", icon = icon('info'), size = "lg", right = T, up = F, width = '400px',
div('my text', style = 'font-size:10px')
),
tags$head(tags$style(
"
.btn-dropdownbutton{
background-color: #393D3F !important;
border: solid; border-radius: 4px; border-width: 1px; border-color:#339FFF;
color: #339FFF; text-align: center; font-weight:bold; font-size: 12px;
opacity: 0.5 !important;
}
"
推荐阅读
- javascript - 如何在索引不为 0 的 Javascript 数组上使用数组解构?
- html - 我想像这样创建 Owl Carousel 但我不知道如何解释
- python-3.x - python中Matlab的pdist2等价物如下
- r - R Survey 库中是否有一个函数可以测试单个变量的加权比例是否相等?
- javascript - 如何通过html标签将字符串拆分为数组
- c++ - 如何从文本文件中查找特定数据并进行更改?
- python - 使用 matplotlib 屏蔽一个区域
- python - append 不适用于 lambda 和 map。如何在列表中添加新元素?
- kubernetes - EKS 集群中的应用程序负载均衡器
- c# - 进度条中具有负最小值的 C# 表单