Last updated 2023-08-06 23:09:19

How To Center An Image In Markdown

01: <div align="center"> 02: <img src="/images/centered-image.png"> 03: </div>

Important: Do note that the inline CSS attribute align although still working has long been deprecated. It works in about 80% of modern browsers and there is no official date when it will be removed.

It's the simplest way to center objects in Markdown, but if you prefer a lengthy but safer approach you can use the code below.

01: <img style="display:block;margin:auto" src="/images/centered-image.png">

Here is another article you might like 😊 "How to create a list in Markdown"