@Muriel To apply text alignment manually while writing in Obsidian, use these syntax:
text alignment in paragraphs:
<p style="text-align:center;">
This text is centered
New paragraph with default alignment—the empty line
above terminates the first paragraph. Markdown may
not be allowed in the first paragraph
text alignment in headings:
<h2 style="text-align:center;">
This level 2 heading text is centered
Again empty line terminates the heading block—but
the actual heading is only visible in reading view
You can terminate html blocks using </p>
and </h>
to get rendering in the live preview. Html attribute syntax <tag atr=value>
and <tag atr = value>
are both equivalent. As I said earlier, applying inline formatting while writing content in Obsidian is very clunky and unrecommended—different word processing tools should be used if extensive inline formatting is desired.
Obsidian doesn’t currently support workflows where second non‑markdown word processing tool is used simultaneously but there is a feature request for it: Copy-and-paste rendered version (no markdown) from the editor.
The value used for style
attribute is exact CSS-code with property:value;
syntax.