Align text Justified in Obsidian

Hey there, I am completely new to Obsidian and try to use it since several hours. I am motivated and happy to use it but one thing makes me crazy, is that I am not able to have justified text. I look Help and forums and i get this :

/* _hyphenation and justification /
/
-------------------------------------*/
.cm-s-obsidian, .markdown-preview-view {
text-align: justify;
hyphens: auto;
}

using CSS as far as I understand.
So I go to the CSS panel, quite complicated for me, and try to copy paste somewhere the line code but unsucessfully.

Then I tried to find Themes but dont found any Themes including justified text alignment. I am so surprised that this format is not common. Something is strange.
The rest is very fine so far !

Sorry for my poor english and hope someone can help me

6 Likes
/* reading mode */
.markdown-preview-view p {
	text-align: justify;
	text-justify: inter-word;	
}

/* source view and live preview */
.markdown-source-view.mod-cm6 .cm-line {
	text-align: justify;
	text-justify: inter-word;	
}

Add to Snippet folder in Dot Obsidian folder. Be sure to activate snippet in Obsidian settings. Hope it works for you.

16 Likes

Thanks for your help.
Indeed it s not working but I think I am not so far!
I found my .obsidian, I manage to make appear the Snippet folder. And then I naively think I have to create a text file (I named it “align”) and copy paste the text you gave me. Then i launch Obisidian but nothing change…
Where is my mystake ?
Thanks again !

1 Like

Not quite! Instead of a text file, it should be a .css file. You can call it whatever you like! Then it should appear in the list at the bottom of the Appearance tab on settings, where you have to turn it on.

4 Likes

It works ! Yeeeppaa
I finally understood that a CSS file is NOT a text file that you rename .css (LOL)
Thanks at both of you.
Cheers

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.