Dear ladys and gentleman,
do you know how to set left and right margins?
At the moment I have so wiede text blocks on the pc
and when I use Enter for new lines I get a terrible layout on the smartphone.
Do you have some ideas?
Thank you so much in advance for your time
and of course your help
I couldn’t find anyting in:
- overview Styling & HTML
- topics in forum
You can use CSS styling from this template as an example: they are supposed to wrap text after 800 px.
I strongly advise against using linebreaks without semantic meaning. Purely visual customizations should be done with CSS.
body and the
div are HTML elements. They have identifiers by which they’re selectable in CSS:
body element has the class
card which can be selected with a leading dot (
- the same class can be given to any number of elements
- you could also use the HTML tag (
body), but that’s a bit less specific - best would be to combine the two into a single selector:
- the highlighted div has an id:
qa (question/answer) which would be selected with a leading hashtag (
- an id should be a unique identifier for a single element, so there’s no need for
Now that we know what we can style, let’s apply some CSS to solve your issue:
max-width: 900px; // arbitrary
Why not target the body?
- because we should apply size limits to the closest parent container of the text you want to restrict, which in Anki’s case is
#qa - anything above in the HTML hierarchy would work too, but isn’t necessary and could have unwanted effects. Similar to the combined CSS-selector above, we want to be as specific as possible to achieve our goal.
font-size: 20px;color: black;
Got it, and btw:
mx-width of 300px is the exact width for anki android