I can’t get text colours to work. This problem has now bothered me across Anki versions from at least Anki 2.1.x to 24.11-qt6, and also on AnkiDroid. I have tried to disable everything except for the respective Chinese addons (Chinese redux before, now Chinese 3), to no avail. Here’s a screenshot of a note from the card browser, and one from the field where I would expect the colours to show up:
This is how the backside of the card looks like:
Here is the template for the backside of the card:
<div class="tags">{{Deck}} {{#Tags}} -- {{/Tags}}{{Tags}}</div>
<div class="answer">
<div class="chinese">{{Hanzi}}</div>
<div class="pinyin">{{Pinyin}}</div>
{{#Simplified}}<div class="chinese"><span class="comment">Simplified:</span> {{Simplified}}</div>{{/Simplified}}
{{#Traditional}}<div class="traditional"><span class="comment">Traditional:</span> {{Traditional}}</div>{{/Traditional}}
<hr>
<div class="meaning">{{English}}</div><br>
<div class="meaning">{{German}}</div>
{{#Mean Word}}<div class="chinese"><span class="comment">Mean Word:</span> {{Mean Word}}</div>{{/Mean Word}}
{{#Also Written}}<div class="chinese"><span class="comment">Also written:</span> {{Also Written}}</div>{{/Also Written}}
<hr>
<!-- {{Sound}}-->
</div>
<div class="comment"> <!-- Word lookup -->
<a href="http://www.mdbg.net/chindict/chindict.php?page=worddict&wdrst=0&wdqb={{text:Hanzi}}">MDBG</a>,
<a href="http://zhidao.baidu.com/q?word={{text:Hanzi}}&ct=17&pn=0&tn=ikaslist&rn=10&lm=0&fr=search">百度</a>,
<a href="http://image.baidu.com/i?ie=utf-8&word={{text:Hanzi}}">Image</a>
</div>
Here is the corresponding styling:
.card {
font-family: arial;
font-size: 30pt;
text-align: center;
color: black;
background-color: white;
}
.card { word-wrap: break-word; }
.win .chinese { font-family: "MS Mincho", "MS 明朝"; }
.mac .chinese { }
.linux .chinese { font-family: "Kochi Mincho", "東風明朝"; }
.mobile .chinese { font-family: "Hiragino Mincho ProN"; }
.chinesetop { font-size: 38pt;}
.chinese { font-size: 28pt;}
.traditional { font-size: 32pt; margin-top: 1ex; margin-bottom: 1ex;font-family: "Kochi Mincho", "東風明朝"; }
.pinyin { font-size: 20pt; }
.meaning { font-size: 20pt; }
.smallmeaning { font-size: 14pt; }
.comment {font-size: 10pt; color:grey; margin-top: 3ex; }
.tags {color:gray;text-align:right;font-size:10pt; background-color: #fafad0;}
.note {color:gray;font-size:20pt;margin-top:20pt;}
.meanword { font-size: 20pt; }
.hint {font-size:20pt;}
.answer { /* background-color:bisque; border:dotted;border-width:1px */}
.tone1 {color: "red" !important;}
.tone2 {color: "orange" !important;}
.tone3 {color: "green" !important;}
.tone4 {color: "blue" !important;}
.tone5 {color: "gray" !important;}
Originally, I didn’t have the “!important” flags set, but that didn’t make a difference, either.
I feel I must be doing something really wrong, but can’t find it. Can anyone please help?