# 如何添加简单横幅

**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:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Yves\_Lauzin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yves_lauzin/32/126897_2.png) [@Yves\_Lauzin](https://meta.discourse.org/u/Yves_Lauzin)
#### Post date: [2021年一月8日 06:36 UTC](https://meta.discourse.org/t/how-to-add-a-simple-banner/175447/1 "2021-01-08T06:36:08Z")

</div>

你好

来自法国的一个问题，所以我不确定该在哪里发布这个答案：grinning:  
我想在 Discourse 的顶部添加一个简单的水平图片横幅。  
您有什么建议吗？

此致

YL

---

<div class="post-metadata">

### Author: ![Bcat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bcat/32/163148_2.png) [@Bcat](https://meta.discourse.org/u/Bcat)
#### Post date: [2021年一月8日 06:45 UTC](https://meta.discourse.org/t/how-to-add-a-simple-banner/175447/2 "2021-01-08T06:45:27Z")

</div>

主页：[Theme Creator](https://theme-creator.discourse.org/theme/Bcat/homepage-banner)

查看更多：[Beginner's guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966#heading--1-2)

---

<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)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023年八月19日 13:30 UTC](https://meta.discourse.org/t/how-to-add-a-simple-banner/175447/4 "2023-08-19T13:30:33Z")

</div>

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