Angular Fullcalendar-can';不要更改日历的背景色

Angular Fullcalendar-can';不要更改日历的背景色,angular,fullcalendar,Angular,Fullcalendar,我尝试更改fullcalendar的背景色 我尝试了这些方法(没有成功): 我的依赖项: “@angular/core”:“~9.0.5”、“@fullcalendar/angular”:“^4.4.5-beta”、“@fullcalendar/core”:“^4.4.0” 更新: 我尝试将类添加到fullCalendar(未成功) 您需要在general style.css中尝试css更改。如果在component.css中编写,则无法更改它 如果您的日历上有更多内容,请将类添加到您的日历中

我尝试更改fullcalendar的背景色

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

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

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


您需要在general style.css中尝试css更改。如果在component.css中编写,则无法更改它


如果您的日历上有更多内容,请将类添加到您的日历中
addclass
我在一些地方使用FullCalendar组件。日历的视图因组件而异。以前,我可以在compoennt样式中为任何日历设置css样式。然后将类添加到日历元素标记中,并在样式css中更改此类样式。因此,我更改了fullcalendar类。我更改了scss(在global style.scss中),除背景色(.fc td)外,一切正常。这是我的代码:``.testClass{.fc视图容器{background:#ffffffff 57!important//working}.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列表视图、.fc unthemed.fc列表标题td{边框颜色:#949494;//worikng}.fc td{背景颜色:#333!重要;//notworking}``我编辑了这样的答案。将类放到元素标记中,并在样式css中放置。在样式的前面进行测试。然后你用类统一每个日历。你的代码是完整的,但不会更改背景颜色。要更改背景颜色,我可以使用.fc td{background color:#333!important;}这在没有.testClass的情况下是可行的。当我在一个不起作用的testClass中添加这个时。你考虑过创建一个主题吗?看。根据你的需求调整一个现有主题可能不会太难。
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;
}
<full-calendar
  #specCalendar
  ...
  [className]="'spectator-calendar'"
  >
    .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;
}