# 自定义 CSS，使已发布的页面继承特定类别（子类别）的背景以及帖子的背景（如果有）

**URL:** https://meta.discourse.org/t/customize-css-so-that-the-published-page-inherits-the-background-of-a-certain-category-subcategory-and-the-background-if-any-of-the-post/243356
**Category:** Marketplace
**Created:** [2022 年10 月 31 日 06:31 UTC](https://meta.discourse.org/t/customize-css-so-that-the-published-page-inherits-the-background-of-a-certain-category-subcategory-and-the-background-if-any-of-the-post/243356 "2022-10-31T06:31:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### 作者： ![Aizada\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aizada_m/32/352050_2.png) [@Aizada\_M](https://meta.discourse.org/u/Aizada_M)
#### 发布日期： [2022 年10 月 31 日 06:31 UTC](https://meta.discourse.org/t/customize-css-so-that-the-published-page-inherits-the-background-of-a-certain-category-subcategory-and-the-background-if-any-of-the-post/243356/1 "2022-10-31T06:31:37Z")

</div>

**您希望完成什么？**  
自定义 CSS，以便已发布的页面继承特定类别（子类别）的背景以及帖子的背景（如果有）。

我知道我的任务对某些人来说可能非常简单。但我不是程序员，我被迫在市场上发布此公告。

在元论坛上一位好心人的帮助下，我能够为特定帖子设置页面发布规则。但我未能针对某个类别或子类别的所有帖子设置此类规则。  
这是我的 CSS 代码示例 👇

```plaintext
  &.knopka-test-raboty-novoj-komandy.topic-1104.staff {
    background-color: #c4ddc4;

    .published-page-header {
      background-color: #0d7736;
    }

    blockquote {
      background-color: #facccc;
      border: 5px solid #fb7878;
    }
  }
}

```

**您何时需要完成？**

我可能错了，但我认为这项任务最多需要一个小时。

**您能为这项任务提供多少美元预算？**  
我的预算是 25 美元

---

<div class="post-metadata">

### 作者： ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### 发布日期： [2022 年10 月 31 日 12:05 UTC](https://meta.discourse.org/t/customize-css-so-that-the-published-page-inherits-the-background-of-a-certain-category-subcategory-and-the-background-if-any-of-the-post/243356/2 "2022-10-31T12:05:30Z")

</div>

我大概能帮你做。🙂

---

<div class="post-metadata">

### 作者： ![Aizada\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aizada_m/32/352050_2.png) [@Aizada\_M](https://meta.discourse.org/u/Aizada_M)
#### 发布日期： [2022 年10 月 31 日 13:11 UTC](https://meta.discourse.org/t/customize-css-so-that-the-published-page-inherits-the-background-of-a-certain-category-subcategory-and-the-background-if-any-of-the-post/243356/3 "2022-10-31T13:11:15Z")

</div>

你好。 🙋‍♂️  
太好了，我很乐意接受你的帮助！ 😃

---

<div class="post-metadata">

### 作者： ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### 发布日期： [2022 年11 月 30 日 13:11 UTC](https://meta.discourse.org/t/customize-css-so-that-the-published-page-inherits-the-background-of-a-certain-category-subcategory-and-the-background-if-any-of-the-post/243356/4 "2022-11-30T13:11:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
