我在 angular 工作,我开了一个 ngbpopover
.但我想给它的边框,如设计所示。
如果有人知道该怎么做,请帮助我。
Currently my design is like this as below. But I want it as per above image.
最佳答案
我被发现了一些黑客。希望它会帮助你。 (将此类添加到 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/