jhlee
February 13, 2025, 5:33pm
1
I’m trying to add my lectures notes to Anki and enlarge the images.
This is my current code:
/* IMAGE STYLE */
img {display: block; max-width: 200%; max-height: none; margin: 10px auto 10px auto; margin-left: auto; text-align: center;}
tr {font-size: 12px}
However, the output for this code is as follows:
Is there a way to center the image on the Anki card? I tried everything. I even tried copying the code into AI to have it centered but the image is not centering. It’s always going to the right.
I don’t want to make it smaller because I want to be able to read the slides. Is there a way to edit the styling to make sure all images are centered? Maybe, it’s a left margin issue?
Yes, it is possible. I have done it in my own card templates and it works on (at least) Desktop and Android.
It would be helpful to have your html (front and back) and css in three separate codeblocks , because otherwise the site might eat some formatting.
You can do a block like this:
```
My code goes here
```
1 Like
I’ve written a way to zoom and pan images when reviewing. I’m not sure this helps you, but I really needed this when I first used Anki.
I’ve written this from seeing the common trouble of seeing big images such as slideshows as seen from this thread . For the time being, I’m satisfied with being able to click/tap and pan around. I won’t be adding further functionality like panning by dragging the mouse. I’m licensing this as 0BSD so feel free to adopt this into your cool card template or addon, i don’t need attribution.
Demonstration: Basic front side card template
'use strict';
var isAnkiweb;
var qaElm;
var cssEval;
v…
1 Like