# 如何将 Navbar SVG 图标设为白色？

**URL:** https://meta.discourse.org/t/how-to-make-navbar-svg-icons-white/301003
**Category:** Development
**Tags:** css
**Created:** [2024年三月26日 14:20 UTC](https://meta.discourse.org/t/how-to-make-navbar-svg-icons-white/301003 "2024-03-26T14:20:46Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [2024年三月27日 00:43 UTC](https://meta.discourse.org/t/how-to-make-navbar-svg-icons-white/301003/8 "2024-03-27T00:43:40Z")

</div>

这是我的图标，这是它们的“检查元素”：

 ![bbbb](https://global.discourse-cdn.com/meta/original/4X/6/6/f/66f5c6b09d37eb9cc3086bfc0b842b6ecbb50cc3.png)

我尝试了您列出的所有 CSS 代码，包括尝试“stroke”和“fill”。“!important”方法也无效。我不知道是什么原因造成的。  
不过，我可能发现了一些问题。我注意到，尽管我使用的是 .SVG “图像”，但“检查元素”仍然将它们显示在 `<img>` 标签中，而不是像您的那样显示在 `<svg class="` 中。这是 [Custom Header Icons](https://meta.discourse.org/t/custom-header-links-icons/86307) 的一个 bug 吗？

---

_[View the full topic](https://meta.discourse.org/t/how-to-make-navbar-svg-icons-white/301003)._
