Adding an image alt tag and a caption to the same image

#1

Is the only way to add Alt text / an Alt tag to an image to do it in Markdown as Alt text?

If so, how do I then add an image caption as I would if I used an image card?

#2

Yes, markdown or HTML is currently the only way to add an alt tag. If you want to use captions in markdown/HTML cards then you’d need to use the same markup that the rich-text image card generates, something like this:

<figure class="kg-card kg-card-image kg-card-hascaption">
    <img src="..." alt="..." class="kg-image">
    <figcaption>...</figcaption>
</figure>

Note that you’ll still need to use HTML even in the Markdown card, if you are using markdown make sure that you have a blank line before/after the <figure></figure>

#3

Hello hello,

With the markdown way of doing it, pics are optimized like when uploading through the Koenig editor, but the dynamic resizing won’t work, did I get that right?

#4

@Caucasus-and-Mercury if you are writing the HTML as in the example I gave then you can add classes to the <figure> element to change with width of the image if that’s what you are referring to.

Standard:
<figure class="kg-card kg-card-image">...</figure>

Wide:
<figure class="kg-card kg-card-image kg-width-wide">...</figure>

Full-width:
<figure class="kg-card kg-card-image kg-width-full">...</figure>
#5

Amazing! Thanks Kevin!

closed #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.