gpt4 book ai didi

angular - 如何将 ng-select 组件的边框颜色更改为红色?

转载 作者:行者123 更新时间:2023-11-28 14:18:16 26 4
gpt4 key购买 nike

我的 Angular html 模板中的选择组件显示正常。但是我想用红色边框显示这个组件,目前它以灰色显示。我无法做到这一点。

我正在使用 Angular 5

<ng-select class="custom" [searchable]="true" formControlName="contactList" [items]="contactLists" 
bindLabel="name"
placeholder="{{ 'PLACEHOLDERS.CONTACT_LIST' | translate }}" [compareWith]="compareResource">
</ng-select>

自定义的css在文件中定义如下

.ng-select.custom {
min-height: 0px;
max-width: 350px;
}
.ng-select.dropdown {
border: 1px solid black;
}

最佳答案

您可能正在寻找的是 ::ng-deep*。检查documentation了解更多详情。*请注意,它目前处于弃用状态。

::ng-deep .ng-select.custom {
min-height: 0px;
max-width: 350px;
}

::ng-deep .ng-select.dropdown {
border: 1px solid black;
}

关于angular - 如何将 ng-select 组件的边框颜色更改为红色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55571119/

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