# 如何添加简单横幅

**URL:** https://meta.discourse.org/t/how-to-add-a-simple-banner/175447
**Category:** Support
**Created:** [2021年一月8日 06:36 UTC](https://meta.discourse.org/t/how-to-add-a-simple-banner/175447 "2021-01-08T06:36:08Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [2021年一月8日 09:51 UTC](https://meta.discourse.org/t/how-to-add-a-simple-banner/175447/3 "2021-01-08T09:51:59Z")

</div>

### 选项：[多功能横幅主题组件](https://meta.discourse.org/t/versatile-banner/109133)

实现此功能最简单的方法可能是使用这个主题组件。它还允许针对显示时机进行其他自定义，例如仅限主页、仅限匿名用户等。

* * *

### 选项：简单的 HTML/CSS 主题组件（全站范围）

如果您只需要一个简单且覆盖全站范围的横幅，这可能是最轻量级的方案：

- 进入 管理 \> 自定义 \> 主题 \> 组件 \> 安装 \> + 创建新组件。
- 输入名称，例如“全站横幅”，选择类型为“组件”。
- 编辑新组件的 CSS/HTML，选择“通用 \> 页眉之后”，然后输入您的横幅 HTML/CSS。如果您愿意，还可以分别为移动端和桌面端指定不同的横幅，只需选择“移动端”或“桌面端”而非“通用”即可。
- 将该组件添加到您当前使用的主题中以激活它。

* * *

### 选项：[横幅主题帖](https://meta.discourse.org/t/new-banner-topic-pin-type/16458)

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-simple-banner/175447)._
