popover - 如何为 ngbpopover 设置边框

标签 popover ng-bootstrap bootstrap-popover

我在 angular 工作,我开了一个 ngbpopover .但我想给它的边框,如设计所示。
如果有人知道该怎么做,请帮助我。
enter image description hereCurrently my design is like this as below. But I want it as per above image. enter image description here

最佳答案

我被发现了一些黑客。希望它会帮助你。 (将此类添加到 ionic 的全局样式中。)

 .my-custom-class {
    background: aliceblue;
    font-size: 125%;
    border: 2px solid black;
  }

  .my-custom-class .arrow:after,
  .my-custom-class .arrow:before {
    content: "";
    display: block;
    position: absolute;
    left: 100%;
    width: 0;
    height: 0;
    border-style: solid;
  }

  .my-custom-class .arrow:after {
    top: -1px;
    border-color: aliceblue transparent transparent transparent;
    border-width: 10px;
  }

  .my-custom-class .arrow:before {
    top: 0px;
    left: calc(100% - 2px);
    border-color: black transparent transparent transparent;
    border-width: 12px;
  }
并将相同的类应用于 ngb popover ,例如:
<button type="button" class="btn btn-outline-secondary" ngbPopover="Nice class!" popoverClass="my-custom-class"> Popover with custom class

引用来自 CSS triangle custom border color

关于popover - 如何为 ngbpopover 设置边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62512764/

相关文章:

angular - 如何扩展 NgbDropdown 或为其编写包装器?

javascript - Bootstrap Popover 中的 MathJax 没有正确显示

jquery - Bootstrap 时的弹出窗口延迟不起作用

ios - 如何在 iPhone 上以编程方式在 Swift 中将 UIViewController 呈现为弹出窗口

angular - ng-bootstrap typeahead TypeError : Object(. ..) 不是函数

javascript - 使用选择选项销毁 Bootstrap Popover

SwiftUI:在 iPhone 上显示弹出框?

javascript - 如何通过 Javascript 在 Popover Content (Bootstrap) 中添加 Html 标签(如 <button>)

Angular:如何将输入集中在 ngbDropdown 菜单中?