在尝试更改弹出箭头的颜色时,我尝试了一些在线找到的解决方案。这是我的CSS,它位于一个自行创建的popover.css文件中(此处的其他CSS可以正常工作)。
nuevo.json
答案 0 :(得分:1)
不确定您使用的是哪个版本的引导程序,但看起来您的选择器不太正确。这对我来说适用于4.0版(基于此处的示例:https://getbootstrap.com/docs/4.0/components/popovers/):
.arrow::after, .bs-popover-bottom .arrow::after {
border-bottom-color: black !important;
}
答案 1 :(得分:1)
对于Bootstrap 5,请使用以下命令:
.popover .popover-arrow::before, .popover .popover-arrow::after {
border-color: #FFA500 !important; /* this example changes the arrow to orange color... You can always replace with any color you choose. */
border-top-color: transparent !important;
border-bottom-color: transparent !important;
}
请注意,在撰写本文时,引导程序5处于alpha阶段。这可能与稳定的Bootstrap 5版本兼容或不兼容。但是,我怀疑从此刻起,有关源代码的任何事情都将发生变化。•因此,对于稳定发行版的Linux,这应该是非常标准的Bootstrap 5。
您可以将以上代码保存在单独的CSS文件中(例如custom.css
),然后将其链接到HTML
部分中的<head></head>
文件中...希望这对在那里的人有所帮助