简体   繁体   English

如何更改 Angular 材质日期选择器的弹出日历样式

[英]How to change the styling of popup calendar of Angular material date picker

I am only allowed to use Angular material (No Bootstrap or any other library).我只被允许使用 Angular 材料(没有 Bootstrap 或任何其他库)。

在此处输入图片说明

How can I change the style of this popup calendar?如何更改此弹出式日历的样式? Like the font, of the background color, or instead of circle I want it in square button like style or the arrows for navigating back and forth.像字体、背景颜色或圆形一样,我希望它采用方形按钮,如样式或用于来回导航的箭头。

Just right click on the date picker and check what CSS class have used.只需右键单击日期选择器并检查使用的 CSS 类。 Copy the CSS class name and write new CSS style with the same class name.复制 CSS 类名并使用相同的类名编写新的 CSS 样式。 In this way, you can overwrite the CSS style.这样,您就可以覆盖 CSS 样式。

Suppose, the round/circle default CSS class is ".mat-calendar-body-cell-content".假设圆形/圆形默认 CSS 类是“.mat-calendar-body-cell-content”。 Now copy the class name and make a new class like below.现在复制类名并创建一个如下所示的新类。

.mat-calendar-body-cell-content{
     background: #FFCC00 !important;
}

This new style will over right the existing CSS style.这种新样式将取代现有的 CSS 样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM