# 更改单个类别的字体

**URL:** https://meta.discourse.org/t/change-the-font-on-a-single-category/196495
**Category:** Support
**Created:** [2021年七月8日 18:12 UTC](https://meta.discourse.org/t/change-the-font-on-a-single-category/196495 "2021-07-08T18:12:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [2021年七月8日 18:12 UTC](https://meta.discourse.org/t/change-the-font-on-a-single-category/196495/1 "2021-07-08T18:12:30Z")

</div>

我有一些用于分类的自定义字体，但需要让其中一个与众不同。我搜索了一下，却找不到相关方法。通过控制台，我找到了打算测试的那个分类的 ID，但遇到了这个错误：

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/0/c058cb9b1fcef315104b548bf09f5323729540b3.png)

举个例子，如果我想让这里的"bug"与"howto"和"feature"不同，使用 Arial 字体：

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/d/2d3557ef6224326a83be7dcecc1cae81d739753e.png)

有人能分享一下方法吗？

谢谢！

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [2021年七月8日 18:50 UTC](https://meta.discourse.org/t/change-the-font-on-a-single-category/196495/2 "2021-07-08T18:50:58Z")

</div>

如果特定类别没有（不变的）ID，那么将 CSS 应用于第二个或第三个 h4，或者 whichever 那个元素呢？这虽然不是最理想的方案，但在你重新排列类别之前可以正常工作。

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [2021年七月8日 19:47 UTC](https://meta.discourse.org/t/change-the-font-on-a-single-category/196495/3 "2021-07-08T19:47:30Z")

</div>

你好，

你可以针对 `[data-category-id="x"]` 进行定位，例如 #Contribute > Bug 类别的 `data-category-id="1"`。你可以在这里查看：⬇

 ![Screenshot 2021-07-08 at 21.35.17](https://global.discourse-cdn.com/meta/original/3X/7/8/78c3f0522f394022f7d0590c4f61f5e993324335.jpeg)

* * *

```plaintext
.category-list tr[data-category-id="1"] h3 {
    font-family: Arial, sans-serif;
}

```

希望这能帮到你 🙂

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [2021年七月9日 11:40 UTC](https://meta.discourse.org/t/change-the-font-on-a-single-category/196495/4 "2021-07-09T11:40:03Z")

</div>


