How to add captions (such as below images) but anywhere? #1669
-
Checklist
How did you create the site?Generated from DescriptionI would like to add captions to things other than images, such as blocks of code or iframes. Operations you have already triedLooking at previous posts I've created, I used to add Has this feature been removed? Changed? Anything else?No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure about As an option, you can add custom styles to em {
display: block;
text-align: center;
font-style: normal;
font-size: 80%;
padding: 0;
color: #6d6c6c;
} and then use in posts like <em>This is my caption</em> Feel free to adjust per your needs. |
Beta Was this translation helpful? Give feedback.
I'm not sure about
<my-caption>
existence and I didn't find it in the code.As an option, you can add custom styles to
assets\css\jekyll-theme-chirpy.scss
as follows to recreate same styles as for built-in captions:and then use in posts like
Feel free to adjust per your needs.