I am developing a new card type. I want a line on the back of the user’s card to look like this…
Mnemonic: {{Mnemonic}}
…where the label is in a smaller font and the field content is in a different color text. That all works fine. But I can’t get rid of a line break after the colon.
…still causes a line break between the <span>s. So it has nothing to do with the colon or space that ended the first span—it’s the multiple spans alone that generates the line break. Is this not a bug?
Thanks @kelciour. However, there are no HTML tags in any of the test card Mnemonic field contents. If I insert “text:” as you suggested in your item 1, I still get the line break, but I lose any graphic content in the Mnemonic field.
Maybe your Styling section contains something like this to make it look like there’s a line break after "Mnemonic: ".
.reminder {
display: block;
}
I can’t think of anything else. I’d suggest to either install the AnkiWebView Inspector add-on or set the env var QTWEBENGINE_REMOTE_DEBUGGING to 8080 prior to starting Anki to enable Chrome DevTools. With Chrome DevTools it should be clear why there’s a line break.
Apparently, the display attribute of the mnemonic element(id="Item0" class="mnemonic") is set to block by the following line in the showItem() function :
@hkr, this was indeed the problem! (Part of the problem was that I didn’t fully understand the function of the block attribute.) I have updated the note type’s back template to set the mnemonic’s display attribute to inline-block and then to get the buttons on a new line after the mnemonic I have enclosed them in their own <div>.
It’s Anki 2.1.38 (Windows version). I customized the top bar and the bottom bar using css and javascript. The panel at the right side is AnkiWebView Inspector add-on (which I published to Ankiweb).