如何更改 ngBootstrap datepicker 边框半径

how to change ngBootstrap datepicker border-radius

我想将 ngBoostrap 日期选择器的边框半径设置为 0。

CSS:

[_nghost-c9] {
   border-radius: 0.25rem;
}

HTML:

<ngb-datepicker _ngcontent-c7="" tabindex="0" _nghost-c9="" class="ng-untouched ng-pristine ng-valid">
</ngb-datepicker>

我不想更改 ngBootstrap 的任何代码。有没有一种方法可以覆盖这个 css?

喜欢下面

ngb-datepicker[_nghost-c9] {
  border-radius: 0.50rem;
}

这应该有效

您甚至可以将任何父项 class、标签等添加到您的选择器

div [_nghost-c9]{}

或将 class 添加到您的元素中,称其为

.my-class[_nghost-c9]{}

试试这个 Example Link here

将 class 添加到 ngb-datepicker 称为 c-datepicker

<ngb-datepicker #dp [(ngModel)]="model" (navigate)="date = $event.next" class="c-datepicker"></ngb-datepicker>

添加css

.c-datepicker{
  border-radius:0!important;
}