Text alignment not working

Hey all.

So I have a small problem and the help I could find was too advanced for me. I have a page where I need a single block of text to be right-aligned. I started out by just using raw html-tags like this:

<div style="text-align: right"> your-text-here </div>

But as I understand, Hugo renders markdown to HTLM and thus HTML gets wiped… or at least it does for me. I then read somewhere that I had to use shortcode but I can’t find alignment shortcode for Hugo anywhere. I also found a link to someone talking about custom shortcode but I don’t understand how to define that or where to put it.

Can anyone help me understand?


First of all inline styles are not a good practice.

Second you need to set the unsafe parameter to true in your project’s config to output HTML entered in a Markdown content file.

For example In config.toml you should enter:

unsafe= true
1 Like

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