How to Center Images and Text in Github Markdown and READMEs
March 18, 2020
git
TLDR
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"
.
html
1.<p align="center">2.// Your content3.</p>
Example
html
1.<p align="center">2. <img width="200" src="http://material-bread.org/logo-shadow.svg" alt="Material Bread logo">3.</p>
Also, check out the live example.
Align Text Defined As HTML Already
If your text is already defined in your markdown as an HTML tag, then you can add the align
attribute directly on the HTML tag itself.
html
1.<h1 align="center">Material Bread</h1>