# Replace color for text for all cards

**URL:** <https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466>\
**Category:** Card Design\
**Created:** [October 27, 2021, 7:56am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466 "2021-10-27T07:56:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![denbi00](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denbi00](https://forums.ankiweb.net/u/denbi00)\
**Post date:** [October 27, 2021, 7:56am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466/1 "2021-10-27T07:56:01Z")

</div>

Hello everyone! Recently, I got some problems with the cards I created, so I need some help. The cards I created (almost 2000) have some text highlighted in a dark blue color. I did it to make the learning easier but recently I discovered that this dark blue color is almost invisible in night mode. Mostly I gonna learn cards in night mode, so I want to replace this dark blue with a lighter one.  
I know that Anki uses some HTML, and I was thinking about seeking the color code in HTML and replacing it with a new one. But I don’t know how to do it for all decks and cards I have. Do you have any ideas on how I can replace a specific color for all cards?

---

<div class="post-metadata">

**Author:** ![Rumo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rumo/32/1505_2.png) [@Rumo](https://forums.ankiweb.net/u/Rumo)\
**Post date:** [October 27, 2021, 8:40am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466/2 "2021-10-27T08:40:14Z")

</div>

You can define separate colours for light and night mode by adding something like this to your template styling:

```css
.highlight {
 color: blue;
}

.nightMode .highlight {
 color: lightblue;
}

```

Look at the HTML of some field (Ctrl+Shift+X) to find out what styling is used for your highlighted text, probably something like `color="#0000ff"`. If you don’t use any other styling, a simple Find & Replace with `class=highlight` will do the trick. But make sure to have a backup and let us know if the case is more complicated. 🙂

---

<div class="post-metadata">

**Author:** ![denbi00](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denbi00](https://forums.ankiweb.net/u/denbi00)\
**Post date:** [October 27, 2021, 9:09am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466/3 "2021-10-27T09:09:32Z")

</div>

Rumo, thank you for your response. Do you offer to replace  
`<b>rummage</b><div><font color="#00007f">/ˈrʌm.ɪdʒ/</font><br></div><div>[sound:rummage.mp3]<br></div>`  
to  
`<b>rummage</b><div><font class = highlight >/ˈrʌm.ɪdʒ/</font><br></div><div>[sound:rummage.mp3]<br></div>` , right?

The one thing I don’t know is how to edit CSS and HTML for all cards. Should I use some addons?

---

<div class="post-metadata">

**Author:** ![Rumo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rumo/32/1505_2.png) [@Rumo](https://forums.ankiweb.net/u/Rumo)\
**Post date:** [October 27, 2021, 9:46am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466/4 "2021-10-27T09:46:31Z")

</div>

Yes. No add-ons required, just use [Find & Replace](https://docs.ankiweb.net/browsing.html#find-and-replace) like this:

![grafik](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/0/0aebec760184e1f799de4027e987e99b3c7bae37.png)

---

<div class="post-metadata">

**Author:** ![denbi00](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denbi00](https://forums.ankiweb.net/u/denbi00)\
**Post date:** [October 27, 2021, 10:59am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466/5 "2021-10-27T10:59:39Z")

</div>

🤦‍♂️ I was looking for this feature, but I didn’t find it in the first place.

Ok, I tried to replace the color code with another one (as I wanted at the beginning), and it worked out.  
I like your idea with CSS, so I tried it as well, and it worked out perfectly. Thank you very much for your help!

 ![IMG_0859](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/4/48ffbdf261f0b6e5afd73b95951af9cf74c0c7e5.png)  
 ![IMG_0858](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/5/5111bc348dbce4ee587ac57199d956daf4fd1362.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 7:38am UTC](https://forums.ankiweb.net/t/replace-color-for-text-for-all-cards/14466/6 "2023-05-01T07:38:11Z")

</div>


