gpt4 book ai didi

css - Ng-Bootstrap active 药丸添加下拉不显示

转载 作者:太空宇宙 更新时间:2023-11-03 19:54:51 25 4
gpt4 key购买 nike

我将我的 Angular-6 元素用于 ng-bootstrap我用了ngbootstrap-pills ,我尝试添加 active 药丸到带有删除按钮选项的下拉图标,但它不起作用,任何人都知道如何正确地做到这一点。

这里有stack blitz代码

这是我的 .css 代码

.nav-pills .nav-link.active, .nav-pills.show> .nav-link {
color: #fff;
background-color: #262262;
}

a:after {
content: url('https://image.flaticon.com/icons/svg/60/60995.svg');
height: 0;
width: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
position: absolute;
bottom: -1px;
left: 50%;
margin: 0 0 0 -3px;
z-index: 100;
}

我试着像这张图片那样做

I tried to do like this image

谢谢。

最佳答案

此解决方案不需要 .svg 即可工作。

enter image description here

::ng-deep .nav-pills .nav-link.active, .nav-pills.show> .nav-link {
color: #fff;
background-color: #262262;
position: relative;
}

::ng-deep .nav-pills .nav-link.active:after {
content: '';
position: absolute;
height: 0;
width: 0;

border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
border-right: 6px solid transparent;

display: block;
left: 35%;
bottom: 0;
}

https://stackblitz.com/edit/angular-aticm5-5nnhz3

关于css - Ng-Bootstrap active 药丸添加下拉不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58443279/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com