How can I vertically align the image and text in the image below?
This is the way I’m writing it in my Markdown:
<a name="version"></a>[ ![Download](https://api.bintray.com/packages/edsilfer/maven/search-interface/images/download.svg) ](https://bintray.com/edsilfer/maven/search-interface/_latestVersion) - **MIN API VERSION: 16**
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" .
Aligning text in native markdown is not possible. However, you can align the text using inline HTML tags. To justify, replace right with justify in the above. It works, but it breaks links like <div style="text-align: right"> [up](https://github.com/loretoparisi/CapsNet#CapsNet) </div> will be not rendered as a link.
When the element to be centered is an inline element we use text-align center on its parent. When the element is a block level element we give it a width and set the left and right margins to a value of auto. With text-align: center in mind, most people look first to vertical-align in order to center things vertically.
Solution 2 : use the "align" deprecated attribute This is not recommended, but in some cases this is the only way to center the image. Insert this HTML snippet into your markdown file. You can also try to put the "align" attribute directly into the "img" tag.
I can think of 2 workarounds to this issue
<table><tr><td valign="center"><img ...> text </td></tr></table>
)may not the best way, but it is an improvement :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With