有没有可能用bstooltip
来设计工具提示框的外观? 我已经搜索过答案了,但是关于工具提示,所有对美学的调整似乎只针对宽度(即这个问题)。 考虑shinyBS Githug Pages文档中的MWE,只包括Bstooltip
部分和一些修改后的CSS:
library(shiny)
library(shinyBS)
shinyApp(
ui =
fluidPage(
sidebarLayout(
sidebarPanel(
tags$style(
HTML(
"
.tooltip {
width: 400px;
text-color:black;
background-color:red;
}
"
)),
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30),
bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
"right")
),
mainPanel(
)
)
),
server =
function(input, output, session) {
}
)
结果如下:
看起来好像保存工具提示的div正在改变,但是我想对工具提示本身进行样式化。
使用.tooltip
对容器进行样式设置,请尝试.tooltip-inner
,例如。
tags$style(HTML("
.tooltip > .tooltip-inner {
width: 400px;
color: white;
background-color: red;
}
"))
你可以在这里找到更多的提示。