首页 > 解决方案 > 如何更改 ngBootstrap 日期选择器边框半径

问题描述

我想将 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?

标签: cssangular5ng-bootstrap

解决方案


在此处尝试此示例链接

将类添加到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;
}

推荐阅读