markdown是否支持本机文本对齐而不使用html + css?


当前回答

居中对齐,将你想居中对齐的文本用箭头(-> <-)环绕起来,就像这样:

-> This is center aligned <-

其他回答

我试着将图像居中,答案中建议的技术都不起作用。一个常规的HTML <img>内联CSS为我工作…

<img style="display: block; margin: auto;" alt="photo" src="{{ site.baseurl }}/images/image.jpg">

这是一个在GitHub上托管的Jekyll博客

对于自述文件的Github使用div可以中心一切-

<div align="center">
    Any Text/Card/Item
</div>

但是这样使用p并不适用于所有item-

<p align="center">
    Any Text/Card/Item
</p>

居中对齐,将你想居中对齐的文本用箭头(-> <-)环绕起来,就像这样:

-> This is center aligned <-

原生markdown不支持没有HTML + css的文本对齐。

这有点俗气,但如果你正在使用GFM或其他支持用管道构建表的MD语法,你可以使用列对齐特性:

|| <!-- empty table header -->
|:--:| <!-- table header/body separator with center formatting -->
| I'm centered! | <!-- cell gets column's alignment -->

这在标记中起作用。