DEV Community

Ali Faraji
Ali Faraji

Posted on

Justifying text in dev.to; You Cannot!

Text justification in posts is currently not supported, and attempts to use HTML tags for this purpose are unsuccessful.

For example, this method does not achieve text justification:

<div style="text-align: justify;">
Your text intended to be justified here will not align as expected. Ideally, text should align evenly along both the left and right margins, but this outcome is not achieved with the current setup.
</div>
Enter fullscreen mode Exit fullscreen mode

Similarly, this approach also fails:

<p style="text-align: justify;">
Your text intended to be justified here will not achieve the desired fully justified alignment, where text is evenly aligned with both margins.
</p>
Enter fullscreen mode Exit fullscreen mode

This limitation can be particularly frustrating for those who are used to academic formatting standards. Unfortunately, I have not been able to find any documentation or online resources that offer a solution.

I am just writing to let you know :)))

It would be greatly beneficial if this feature were introduced shortly. Ideally, it could be implemented into the HTML template section, allowing for optional activation in each post to accommodate varying preferences.

-- Ali

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (2)

Collapse
 
bayuangora profile image
Bayu Angora • Edited

HTML

<div class="justify">
<p>
Amit ampun Nya paralun. Agungna ka wujud Gusti nu Maha Suci. Jembarna ka para laluhur sabudér Awun. Ka Ibu Agung ka Rama Agung. Ka Ibu anu henteu muguran. Ka Rama anu henteu munggaran. Deheusna ka Ibu Rama nu jadi cukang lantaran urang gumelar di pawenangan. Nyanggakeun sadaya-daya sasaji sapuratina ngampi sari na parasa pangasih ti Ibu Pertiwi. Bumi Agung, Bumi Alit, silokaning pusaka diri. Pami ka manungsa nu sarasa, nu sasaji. Titiswaris nu sajati.
</p>
</div>
Enter fullscreen mode Exit fullscreen mode

CSS

.justify {
text-align: justify;
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
faraji profile image
Ali Faraji

Hi Bayu,
Thank you for your help, but where should we put the style?
it usually goes into a CSS file and we use the <link /> tag, or it should be in a <style></style> tag which is not allowed in posts apparently :(

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay