Markdown query

I’m using Markdown more and more on my Blog, thanks to @Jannis 's Poster. It is working really well, except I was struggling to centre images and define size.

This is working as a fix:

To center images, text, and anything else in Github markdown and READMEs simply wrap the element in an HTML tag with the align attribute set to "center" .

Image is size defined and centred, but it is html, which I have always tried to avoid!

Is there a ‘proper’ Markdown way of doing this? I can’t find it on Github, IA Writer notes or others - perhaps it is beyond John Gruber’s spec for MD?

No.

You still would be able to center all images inside a blog post with help of CSS.

1 Like

I assume you are using Source, so you could add:

.stripped-markdown img{margin-left:auto; margin-right:auto; display:block}

Add in something likewidth:50%;or width:250px; if you want to apply the same width to all MD images

Which will centre all Source Markdown images.

For a specific Markdown stack, you could add a class such as centimage to the stack class setting and use:

.centimage img{margin-left:auto; margin-right:auto; display:block}

2 Likes

Thank you both. I had my suspicions… I’ll try the code In a few minutes Gary