I am trying to use this, but it looks like I am doing something wrong or maybe we are talking about different things.
I’m using:
<div id="hint2">{{hint:English}}</div>
with CSS:
.hint {
color: purple;
}
#hint2 {
color: blue;
}
But it doesn’t work.
When I say hint fields I mean this: Field Replacements - Anki Manual, so I don’t have two different hint fields because I actually don’t have one either, since this is an internal field used by Anki, if I understand it correctly.
Basically what I want is to have
{{hint:English}}
{{hint:Spanish}}
and each of them will show in a different color.
My current CSS for hints is this,
.hint {
color: purple;
}
but of course it applies to all of them and I don’t know how to separate them with an id/class and how to refer to that from CSS.
Now when I reveal the hints, the text below them is pushed down (as if the revealed hint had a <br> or two at the end).
I don’t think this was happening before, but now even after removing the styling and tags it keeps happening. Other decks are unaffected. Any idea what can be going on?
Make also sure, you don’t have any invisible <br> or   fragments in your card. (Not Notetemplate!).
You can look at this, by opening up the card editor and activating the HTML-Editor (you have to press these small “< >” arrows on top of the field to the upper left - right next to the pin.)
Yes, the html in the fields is clean, if forgot to mention that.
I actually checked and this was happening before the styling change, actually. But I think this is not the normal behavior, and I have some other decks where this doesn’t happen.
Okay. That is weird now. I tinkered a bit… it works now.
I don’t know why (probably it has something to do with the span elements).
You only have to put the span elements into their own div elements. Then it works. It’s not popping up any <br> elements anymore after clicking on the hint.
It probably “didn’t work”, because you forgot, that with your styling you only style the hint text after clicking on the hint. If you still want to style the hint text as is, then you have to set additional selectors.
No, I actually remembered that, the problem was I wasn’t adding the a.hint. I guess that happens because I don’t really know what I’m doing in HTML/CSS and I just experiment with what little I understand. ChatGPT wasn’t being helpful either and I guess I don’t know the right terminology (“class”, “element”…), so my search was not being very productive.