How to Centre an Image in Alloy/Markdown

How do I centre an image in alloy’s editor or markdown?
Thanks

That is not a feature of Markdown unfortunately. My suggestion would be to make your image a bit bigger so that it fills the width of the blog post.

Thanks Adam
Can headings be centred in Markdown?

No, alignment is not a thing with Markdown. Normally you don’t really need or want to center text within a blog post.

OK, thanks again Adam

Not a problem at all.

Not sure if I should be reviving this topic or starting a new one, but here goes.

I have found this code which works well (in the editor’s preview mode at least - I haven’t published the post yet) for centreing images in Markdown.

I’ve replaced the “<” and “>” with “#” because I don’t know how to get the code to show otherwise.

#p align=“center”#
#img src=“image-path-name”#
#/p#

Can anyone kindly tell me how to insert the alt tag?

Thanks

Hi @Phloque

You can use something like this:

<p align="center">
<img src="image-path-name" alt="your-text-here">
</p>

Best

1 Like

Great, thanks egomade
BTW how did you get those lines of code to appear in the post- they don’t seem to be a screenshot

Hi @Phloque

It is a Markdown code block, you can check this @elixirgraphics page for examples.

Best

1 Like

You can also highlight the code after you paste it into a post and then click the “preformatted text” button in the editor tool bar. It has the </> icon.

Thanks egomade and DLH very helpful