簡體   English   中英

Kramdown:我如何設置圖像的位置?

[英]Kramdown: How can I set the location of the image?

Kramdown語法參考所述 ,我們可以設置圖像的高度和寬度大小,如下所示:

Here is an inline ![smiley](smiley.png){:height="36px" width="36px"}.

但是如何設置圖像的位置,比如設置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

您的圖像現在以其父塊為中心。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM