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 2 replies
-
I'm not sure about There are ways to do this using custom styles. Make sure you copy Option 1. Using tag in markdownModify 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> Option 2. By specifying a class with stylesModify .caption {
display: block;
text-align: center;
font-style: normal;
font-size: 80%;
padding: 0;
color: #6d6c6c;
} and then use in posts like This is my caption.
{: .caption } |
Beta Was this translation helpful? Give feedback.
I'm not sure about
<my-caption>
existence and I didn't find it in the code.There are ways to do this using custom styles.
Make sure you copy
assets\css\jekyll-theme-chirpy.scss
from this repository to yours.Option 1. Using tag in markdown
Modify
assets\css\jekyll-theme-chirpy.scss
to add styles as followingand then use in posts like
Option 2. By specifying a class with styles
Modify
assets\css\jekyll-theme-chirpy.scss
to add styles as following