耿俭

Typecho文章图片居中的方法 markdown图片居中代码
Typecho后台文章编辑支持Markdown排版语法,插入图片主要有两种方式。1、行内式图片链接![Alt te...
扫描右侧二维码阅读全文
21
2019/06

Typecho文章图片居中的方法 markdown图片居中代码

Typecho后台文章编辑支持Markdown排版语法,插入图片主要有两种方式。

1、行内式图片链接

![Alt text](/path/to/img.jpg "Optional title")

2、参考式图片链接

![Alt text][id]
[id]: url/to/image  "Optional title"

但是图片显示都是左对齐,而Markdown不支持任何格式,那么如何使图片居中呢?
我们可以借助html语法来实现,如html中的center或div标签,放在Markdown图片链接内容的外面即可,代码如下:

<center>
![Alt text](/path/to/img.jpg "Optional title")
</center>

<div align="center">
![Alt text](/path/to/img.jpg "Optional title")
</div>
最后修改:2019 年 06 月 21 日 12 : 05 AM

发表评论