# 更改维基帖子的样式

**URL:** <https://meta.discourse.org/t/change-the-style-of-a-wiki-post/78881>\
**Category:** Developer Guides\
**Tags:** wiki-posts, how-to\
**Created:** [2018年一月24日 14:41 UTC](https://meta.discourse.org/t/change-the-style-of-a-wiki-post/78881 "2018-01-24T14:41:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [2021年七月28日 02:50 UTC](https://meta.discourse.org/t/change-the-style-of-a-wiki-post/78881/7 "2021-07-28T02:50:37Z")

</div>

为了使 Wiki 自定义在私聊中配合[新变更](https://meta.discourse.org/t/2-8-0-beta4-security-release-new-pm-style-and-more/197878#new-personal-message-pm-style-3)正常工作，我建议对 CSS 稍作调整，使其针对 `.cooked` 类：

```plaintext
// 自定义 Wiki 帖子
.wiki .topic-body .cooked {
    background-color: #e8f9fd;
    animation: none;
}
.post-info.edits .wiki::before {
    content: "Wiki Post";
    margin-right: 5px;
    font-weight: bold;
}

```

我也会将其添加到原始帖子（OP）中。

* * *

_稍后……_  
出于好玩，我将其制作成了主题组件，并支持自定义背景色和文本。

> [@Wikified Posts Component](https://meta.discourse.org/t/wikified-posts-component/199492):
>
> Simple Description This theme component enables you to make Wiki posts (and Shared Edits posts) more obvious. Wikis and Shared Edits are a powerful feature of Discourse, but many users are unfamiliar with the concept and find the UI just a bit too subtle. This component makes it crystal clear, packaging the content from [Change the style of a wiki post](https://meta.discourse.org/t/how-to-change-the-style-of-a-wiki-post/78881). Screenshots Detailed Description Installing this component enables you to control the background colour of Wiki posts, and to add s…

---

_[View the full topic](https://meta.discourse.org/t/change-the-style-of-a-wiki-post/78881)._
