If an Anki card stretches across the full width of a wide monitor and gets hard to read, capping the max width at around 500px fixes it. Anki's default template has no rule that limits width at all, so the wider you make the window, the longer each line gets. In ankieditor, click an empty area of the card to select the whole card, and a number field labeled "Max card width (leave blank for no limit)" appears — type a number there.
Why Does an Anki Card Stretch Across the Whole Screen?
Anki's built-in note types (Basic, Basic (type in the answer), Cloze) have no
max-width in their styling. With no rule capping the width, card
content stretches horizontally as far as the window allows.
That's not an issue on a phone, where the screen is narrow. The problem is the desktop. Maximize Anki on a 24-inch monitor and a single line can run past 100 characters, which makes it hard for your eyes to find the start of the next line after finishing one. Switching alignment to left doesn't fix it either — if the line itself is that long, the same problem remains.
How Wide Should a Card Be?
500px is a good starting value — it's also the placeholder shown in the editor's input field.
- 400px — cards centered on a word and a short meaning. Keeping content narrow and tight keeps your eyes from wandering.
- 500px — typical cards with an example sentence or a two-to-three-line explanation. This is the right place to start for most cards.
- 600px — cards with long prose, tables, or code. Going wider just makes the lines long again.
These are recommended starting points, not measured optimums. If you've set the font size above 20px, fewer characters fit on a line at the same width, so it's more reliable to watch the preview and find the point where a line feels comfortable to read.
How to Change Card Width in ankieditor
- Click an empty area of the preview. The selection indicator in the top left switches to Whole card.
- In the left panel's "Card" section, type a number into Max card width (leave blank for no limit). You can set it anywhere from 200 to 1200, in steps of 10.
- The preview narrows immediately. Try different values until a line reads comfortably.
- Use [Copy Code] to copy the updated code and paste it into
Anki's
Tools → Manage Note Types → Cards...screen.
What Changing Card Width Writes to Your CSS
This field doesn't just write one value — it writes three lines together.
.card { max-width: 500px; margin: 0 auto; padding: 0 10px; }
max-width— the limit on how wide the card can grow.margin: 0 auto— splits the remaining space evenly on both sides, pulling the card to the center. Without it, only the width shrinks and the content stays pinned to the left.padding: 0 10px— keeps text from touching the edges when the screen is narrower than that width. If your template already has padding, this leaves it alone.
Before You Change the Width
Clearing the field only removes max-width.
margin: 0 auto and padding: 0 10px stay in the template.
Without a width limit neither has a visible effect, but they remain in the code —
to fully undo this, delete them yourself in [Show Code].
Barely changes anything on a phone. A phone screen is already
around 500px wide, so it rarely hits the max-width limit. This setting
mainly matters on desktop and tablet.
If your template already sets margin directly, this
overwrites it. If the card had its own margin, that value gets replaced
with 0 auto. Check with [Show Code].
Set this separately for each note type. Card templates are stored in the card types that belong to a note type, so if you use several note types, you'll need to apply it to each one.
Frequently Asked Questions
Can I make an Anki card narrower?
Yes. Add max-width to .card in the styling and set
margin to 0 auto, and the card centers itself within
that width. Since Anki renders cards in a webview, regular CSS applies as-is.
What's a good width in px for a card?
Start around 500px. Go down to 400px for word-focused cards, or up to 600px for long prose. It's a recommended starting point rather than a measured optimum, so it's more reliable to watch the preview and find where a line reads comfortably.
I narrowed the card, but it's stuck on the left side.
That happens when margin: 0 auto is missing. With only
max-width set, the card narrows but stays pinned to the left. Using
ankieditor's max card width field writes both max-width and margin together, so
this doesn't happen.
If long lines make your eyes slip, also see How to Left-Align Text in Anki and How to Change Line Spacing in Anki.