I spend some time designing card types the last days. I wanted to add custom buttons to one of them, when I found some (to me) weird behavior between html buttons and css styling in anki.
Source Code for testing purposes:
Front Template:
{{Front}}
Back Template:
Button
Styling:
.button{
background-color: red;
}
When input like this, the button shows as default. Interestingly enough, when i put < followed by any text (e.g.<asdf) infront of the button code, it works. Code than looks like this:
Back Template
<asdf Button
The button is red then.
I would really appreciate an explanation, if there’s one. Apparently, the little coding knowledge I have is not sufficient to make sense of this.
Where it just says “button” in the code it should really say: <.button class=“button”>Button<./button>" (dots added in order to prevent auto-formating.)