改变bsTooltip框的颜色,使其具有光泽。

问题描述 投票:0回答:1

是否可以用工具提示框的美学风格来设计工具提示框?bsTooltip 在闪亮的?我在SO上找过答案,但关于工具提示,所有关于美学的调整似乎都是只针对宽度的(也就是 这个问题). 考虑到MWE从 shinyBS Githug Pages文档其中,仅包括 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) {

        }
)

结果是这样的

enter image description here

看起来好像是存放工具提示的div在改变 但我想改变工具提示本身的样式。

css r shiny tooltip
1个回答
2
投票

.tooltip 您在设计容器时,可以尝试 .tooltip-inner,例如

tags$style(HTML("
                .tooltip > .tooltip-inner {
                width: 400px;
                color: white;
                background-color: red;
                }
                "))

enter image description here

你可以找到更多的提示 此处.

© www.soinside.com 2019 - 2024. All rights reserved.