Fullcalendar-无法更改日历的背景颜色

时间:2020-04-20 07:16:10

标签: angular fullcalendar

我尝试更改全日历的背景颜色。

我尝试了这些方法(没有成功):

td .fc-unthemed td.fc-today {
 background: red !important;
}

.fc-unthemed td.fc-today > tr > td{
 background: blue !important;
}

.fc-unthemed td.fc-today td{
 background: black !important;
}

.fc-unthemed td.fc-today {
 background: green !important;
 background: linear-gradient(90deg, rgba(204, 204, 204, 1) 0%, rgba(255, 255, 255, 1) 100%);
}

.fc td {
 background-color: #333 !important;
}

.fc th {
  background-color: #333 !important;
}

我的依赖项: “ @ angular / core”:“〜9.0.5”,“ @ fullcalendar / angular”:“ ^ 4.4.5-beta”,“ @ fullcalendar / core”:“ ^ 4.4.0”,

enter image description here

更新: 我尝试将类添加到fullCalendar(没有成功)

<full-calendar
  #specCalendar
  ...
  [className]="'spectator-calendar'"
  >

1 个答案:

答案 0 :(得分:1)

您需要尝试对常规style.css中的CSS进行更改。如果您在component.css中编写,则无法更改。

如果日历上还有更多内容,则将类添加到日历中 添加类<full-calendar class="testClass " 以您的style.css

编写这些代码
    .testClass .fc-view-container {
    background: #ffffff57  !important
}
.testClass .fc-unthemed th, .fc-unthemed td, .fc-unthemed thead, .fc-unthemed tbody, .fc-unthemed .fc-divider, .fc-unthemed .fc-row, .fc-unthemed .fc-content, .fc-unthemed .fc-popover, .fc-unthemed .fc-list-view, .fc-unthemed .fc-list-heading td {
    border-color: #949494;
}
.testClass  .fc-time-grid .fc-slats {
   background:#333 !important;
   color:white;
}