【问题标题】:Bootstrap 5: How to implement gradient color on tooltips?Bootstrap 5:如何在工具提示上实现渐变色?
【发布时间】:2022-01-18 18:10:12
【问题描述】:

我在 bootstrap 5 工具提示

上尝试渐变颜色时遇到了一些问题

CSS:

.tooltip .tooltip-arrow::before {
  position: absolute;
  content: "";
  border-color: transparent;
  border-style: solid;
}

.bs-tooltip-top .tooltip-arrow::before, 
.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
  top: -1px;
  border-width: 0.4rem 0.4rem 0;
  border-top-color: #000;
}

现场示例: https://codepen.io/themes4all/pen/NWabvad

【问题讨论】:

    标签: html css sass tooltip bootstrap-5


    【解决方案1】:

    通过添加 .bg-gradient 类,将线性渐变作为背景图像添加到背景或要使用渐变背景颜色,您需要将 $enable-gradients 属性设置为 true。默认情况下,它设置为 false。 参考链接了解更多 https://www.geeksforgeeks.org/colors-and-gradients-in-bootstrap-with-examples/ https://getbootstrap.com/docs/5.0/utilities/background/

    【讨论】:

      猜你喜欢
      • 2015-08-19
      • 2021-08-12
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      • 2022-08-20
      • 2023-02-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多