【问题标题】:change color of tooltip arrow of ui.bootrap (plunker attached)更改 ui.bootstrap 工具提示箭头的颜色(附加 plunker)
【发布时间】:2016-03-16 17:36:55
【问题描述】:

这里是 plunker 代码。 http://plnkr.co/edit/C1khFJqTUutDaK9ad7ud?p=preview

我需要更改工具提示箭头。示例中工具提示的位置是顶部、底部和左侧。

谁能告诉我如何设置这些工具提示的样式。我需要为工具提示的不同位置为工具提示箭头着色。

例如

tooltip at top-> arrow color should be red
tooltip at bottom-> arrow color green
tooltip at left-> arrow color yellow

谁能告诉我如何获取这些类并将颜色应用于这些工具提示。

这里是代码

HTML

<div ng-controller="TooltipDemoCtrl">
<br><br><br>
  <div ng-class="{'has-error' : !inputModel}">
    <input type="text" ng-model="inputModel" class="test"
      uib-tooltip="Tooltip TBD"
      tooltip-placement="top"
      tooltip-trigger="mouseenter"
      tooltip-enable="!inputModel" />
  </div>
</div>

CSS

.tooltip .tooltip-inner {
            color: white;
            background-color: blue;
            border-radius:5px;
}

.tooltip .tooltip-arrow { 
          //cant get the class for the arrow

}

【问题讨论】:

标签: javascript jquery css angularjs angular-ui-bootstrap


【解决方案1】:

你可以使用tooltip-class,我觉得更方便
http://plnkr.co/edit/FVTuepTS7gXL3K2ixR8e?p=preview

html:

<div ng-controller="TooltipDemoCtrl">
<br><br><br>
  <div ng-class="{'has-error' : !inputModel}">
    <input type="text" ng-model="inputModel" class="test"
      uib-tooltip="Tooltip TBD"
      tooltip-class="tooltip-class"
      tooltip-trigger="mouseenter"
      tooltip-enable="!inputModel" />
  </div>
</div>

css

.tooltip-class .tooltip-arrow{
     border-top-color: red !important;
}

【讨论】:

    【解决方案2】:

    更新关于 batas 的答案。这对我有用。

    .tooltip.top .tooltip-arrow {
    border-top-color: red!important;
    }
    .tooltip.bottom .tooltip-arrow {
    border-bottom-color: green!important;
    }
    .tooltip.left .tooltip-arrow {
    border-left-color: yellow!important;
    }
    

    【讨论】:

      【解决方案3】:

      试试这个,上面的例子

      .tooltip.top .tooltip-arrow {
          border-top-color: red!important;
      }
      

      【讨论】:

      • @bata- 这行得通。谢谢。我正在尝试边框顶部颜色:红色
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-07
      • 2019-07-04
      • 1970-01-01
      • 2017-02-05
      • 2013-09-30
      • 2019-05-03
      • 2015-01-24
      相关资源
      最近更新 更多