How to add class in image markdown in Ghost?

前端 未结 5 1014
被撕碎了的回忆
被撕碎了的回忆 2021-02-07 05:47

In Ghost, the markdown for image is

![alt](src)

Is there a hidden format for adding a class in the img tag? Or is this feature not in G

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-07 06:13

    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.

    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)

    and adress this in css or js

    img[src$='#img-thumbnail'] { float:left;}

提交回复
热议问题