Angular 版本 5,Bootstrap
Angular version 5, Bootstrap
如何根据我的需要编辑原始 bootstrap angular 日期选择器样式 sheet
这是 link
https://ng-bootstrap.github.io/#/components/datepicker/examples#basic
我需要在我的文件中编辑这个日期选择器的颜色。
如果你用的是angularcli,里面有个全局的style.css/style.scss根文件夹(src)。您可以在此处为日期选择器添加自定义样式,检查元素以找到 类 以覆盖样式。
将此添加到样式。css/scss 文件
.ngb-dp-day .btn-light {
background: green !important;
}
.ngb-dp-day .bg-primary {
background: red !important;
}
只需 F12(检查元素)并查看它们的样式:
添加到您的 css:(使用 !important
防止 ovvride)
ngb-datepicker{
background-color: red!important;
}
查看结果:
如何根据我的需要编辑原始 bootstrap angular 日期选择器样式 sheet 这是 link https://ng-bootstrap.github.io/#/components/datepicker/examples#basic 我需要在我的文件中编辑这个日期选择器的颜色。
如果你用的是angularcli,里面有个全局的style.css/style.scss根文件夹(src)。您可以在此处为日期选择器添加自定义样式,检查元素以找到 类 以覆盖样式。
将此添加到样式。css/scss 文件
.ngb-dp-day .btn-light {
background: green !important;
}
.ngb-dp-day .bg-primary {
background: red !important;
}
只需 F12(检查元素)并查看它们的样式:
添加到您的 css:(使用 !important
防止 ovvride)
ngb-datepicker{
background-color: red!important;
}
查看结果: