A wide monitor can stretch an Anki card across its full width, making it hard to read. When that happens, you can fix it in ankieditor by adjusting the card's max width. 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, and the card's width gets capped so it's easier to read even on a wide monitor.
Why Is an Anki Card Hard to Read on a Monitor?
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 monitor 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 the line very long and hard to read. Switching alignment to left doesn't fix it either — if the line itself is that long, it's still uncomfortable to read.
Recommended Card Widths
500px is a good starting value — it's usually the most comfortable to read. Here are examples of when each size fits best.
- 400px — recommended for cards centered on a word and a short meaning.
- 500px — recommended for typical cards with an example sentence or a two-to-three-line explanation. This size works for most cards.
- 600px — recommended for 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 watch the preview and adjust the number until you find the size that works for you.
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 you find the right size.
- Use [Copy Code] to copy the updated code and paste it into
Anki's
Tools → Manage Note Types → Cards...screen.
How to Edit Card Width Directly in CSS
This field doesn't just write one value — it writes three lines together. Use this as a reference if you want to adjust the numbers directly yourself.
.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.
What to Keep in Mind When Changing Card 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 try watching the preview and finding the card width that works best for you.
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 it hard to read your card, also see How to Left-Align Text in Anki and How to Change Line Spacing in Anki.