如何在Ghost中的图像降价中添加类? [英] How to add class in image markdown in Ghost?
问题描述
在Ghost中,图片的降价幅度是
In Ghost, the markdown for image is
![alt](src)
是否存在用于在img
标签中添加类的隐藏格式?还是Ghost还没有此功能?
Is there a hidden format for adding a class in the img
tag? Or is this feature not in Ghost yet?
我想要这样的结果:
<img src="src" alt="alt" class="img-thumbnail">
我不想使用html标记.我真的需要使用markdown实现此目的.请帮忙.
I don't want to use the html markup. I really need to achieve this using markdown. Please help..
推荐答案
在纯markdown 图像类中是不可能的.在某些实施方式中,例如额外的markdown 使用![alt](src) {.class}
.
我尝试过,但是在Ghost中是不可能的,![alt|img-thumbnail](src)
都没有.在 doku 中也没有任何提示.
In plain markdown classes for images are not possible. In some implementations it is possible, e.g. markdown extra uses ![alt](src) {.class}
.
I tried it, but in Ghost it is not possible, neither ![alt|img-thumbnail](src)
. Also no hints in the doku.
但是如果您将src用作css属性,则可以使用解决方法.
But you can use a workaround if you use the src as css-attribute.
只需在网址中添加一个无用的"哈希值即可:
Just add an 'useless' hash to the url:
![alt](src#img-thumbnail)
并在CSS或JS中进行处理
and adress this in css or js
img[src$='#img-thumbnail'] { float:left;}
这篇关于如何在Ghost中的图像降价中添加类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!