# 更改日历背景，使其不透明

**URL:** <https://meta.discourse.org/t/changing-the-background-of-the-calendar-to-be-other-than-transparent/305036>\
**Category:** Development\
**Tags:** events\
**Created:** [2024年三月15日 21:14 UTC](https://meta.discourse.org/t/changing-the-background-of-the-calendar-to-be-other-than-transparent/305036 "2024-03-15T21:14:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenmck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jenmck/32/332487_2.png) [@jenmck](https://meta.discourse.org/u/jenmck)\
**Post date:** [2024年三月15日 21:14 UTC](https://meta.discourse.org/t/changing-the-background-of-the-calendar-to-be-other-than-transparent/305036/1 "2024-03-15T21:14:50Z")

</div>

这是一个很棒的插件！

对我们来说，一个困难之处在于日历的背景是透明的，这会导致与主题颜色冲突。是否可以更改背景？

---

<div class="post-metadata">

**Author:** ![jenmck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jenmck/32/332487_2.png) [@jenmck](https://meta.discourse.org/u/jenmck)\
**Post date:** [2024年四月24日 04:07 UTC](https://meta.discourse.org/t/changing-the-background-of-the-calendar-to-be-other-than-transparent/305036/2 "2024-04-24T04:07:56Z")

</div>

我设法通过更改背景为次要颜色来完成此操作，使用了以下 CSS。我对此并不擅长，所以这可能不是最好的方法，但它有效！

```plaintext
#upcoming-events-calendar,
#category-events-calendar {
    background-color: var(--secondary);
    padding: 1em;
    border-radius: 8px;
    margin-bottom: 1em;
    margin-top: 1em;
}

```
