# 自定义链接文本格式的最佳方法？

**URL:** <https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619>\
**Category:** Development\
**Tags:** custom-header-links\
**Created:** [2019 年5 月 1 日 14:31 UTC](https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619 "2019-05-01T14:31:39Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![alexs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexs/32/139956_2.png) [@alexs](https://meta.discourse.org/u/alexs)\
发布日期： [2019 年5 月 3 日 16:23 UTC](https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619/3 "2019-05-03T16:23:04Z")

</div>

谢谢！我已经完成了，效果非常好。

出于好奇，网站是如何选择使用哪个 CSS 的？如果标准主题组件包含会将字体颜色设置为 `$header_primary` 的 CSS，例如：

```plaintext
.headerLink {
  list-style: none;
  a {
    padding: 6px 10px;
    color: $header_primary;
    font-size: $font-up-1;
  }
}

```

那么它是如何知道要使用我新组件中的 CSS 而不是上面的 CSS 呢？

```plaintext
.headerLink {
  list-style: none;
  a {
    color: #7A7A7A;
  }
}

```

---

_[View the full topic](https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619)._
