How to set the size of replay button in AnkiDroid?

Hello, the following code to set the size of replay button doesn’t work in AnkiDroid (v2.16alpha97).

.replay-button svg {
    width: 15px;
    height: 15px;

P.S. ChatGPT is telling me to modify card_layout.xml and rebuild the application.


Here’s the code that generates the replay button:

Your CSS works in Codepen:

So there might be some other CSS overwriting yours, or your template is faulty in some other way. I don’t know what else it could be. AnkiDroid can be debugged via USB and Chrome developer tools. You’ll need to enable USB debugging in your Android system settings, then enable the option in AnkiDroid’s settings, plug the phone to your desktop via USB and use Chrome to debug.
Tutorial: Remote debug Android devices - Chrome Developers

Change what you have there to this:

.replay-button svg {
    width: 15px !important;
    height: 15px !important;

This works for me using the same alpha build. You have to add !important so that it doesn’t get overwritten afterwards.

Hello, thank you for your reply!
Unfortunately, it doesn’t work and I’ve no idea why :frowning:

I’m sorry. It looks like there’s a minimum height/width set, and that might be your issue. I only checked to see if changing sizes worked and not to something so small. Try this:

.replay-button span svg {
 height: 15px !important;
 width: 15px !important;
 min-width: 15px !important;
 min-height: 15px !important;

Note that it is .replay-button span svg instead of .replay-button svg as that is where the min-width/height is set.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.