How could I center the caption of an image? #2682
-
Hi, I am a noobie in both html and CSS. This page shows how to add an image with caption, but I would like to position the caption in the middle of the image. What is the cleanest way to do that? A follow-up question, how could I create a reference of the image? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
To center the image caption, the canonical way is via CSS: figcaption {
margin-left: auto;
margin-right: auto;
} For "reference", can you elaborate on what it exactly is? |
Beta Was this translation helpful? Give feedback.
-
@iBug Thanks for your prompt reply. Where should I add that CSS? Is it in
I tried this and it didn't work.
I am thinking of a link to the image which I could include in a paragraph, e.g.
|
Beta Was this translation helpful? Give feedback.
-
Please refer to the documentation about customizing the theme's CSS: https://mmistakes.github.io/minimal-mistakes/docs/stylesheets/#customizing For the "image reference" part, you can add an |
Beta Was this translation helpful? Give feedback.
-
Got it. I will check the documentation on that. Thanks so much for the help! Will close this issue for now. |
Beta Was this translation helpful? Give feedback.
To center the image caption, the canonical way is via CSS:
For "reference", can you elaborate on what it exactly is?