正如Kramdown的语法参考中所述,我们可以设置图像的高度和宽度大小,如下所示:
Here is an inline ![smiley](smiley.png){:height="36px" width="36px"}.
但是如何设置图像的位置,例如 set align=center
?
align=center
已弃用。现在你最好使用 CSS。
为了做到这一点,你需要把你的图片放在一个html 块元素中。您的代码可以是:
<div class="img_container">
![Me]({{site.baseurl}}/img/me.jpg){: height="36px" width="36px"}
</div>
在您的 CSS 中,添加:
.img_container{
text-align: center;
}
并且,为了指示 kramdown 解析块内的 html 元素,在 _config.yml 中添加:
kramdown:
parse_block_html: true
您的图像现在位于其父块的中心。