Does anyone know how to code CSS to wrap text around an image that has a caption at the bottom of it?
So -- I'm trying to add a caption underneath a figure (using figcaption). Then I want the text to flow around the figure and its caption.
I seem to be able to EITHER have the caption at the bottom of the figure --OR-- have the text flow around the figure... but not both.
Thank you.
[SOLVED] CSS: How to wrap text around image with caption
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[SOLVED] CSS: How to wrap text around image with caption
Last edited by LockBot on Wed Sep 20, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: CSS: How to wrap text around image with caption
Try tweaking this:
Then for the image HTML:
Code: Select all
<style>
figure {
float: left;
margin: 0 20px 20px 0;
text-align: center;
}
figcaption {
font-style: italic;
text-align: center;
}
figure:last-of-type {
clear: both;
}
</style>
Code: Select all
<figure>
<img src="example.jpg">
<figcaption>Example Caption</figcaption>
</figure>
Linux Mint Una Cinnamon 20.3 Kernel: 5.15.x | Quad Core I7 4.2Ghz | 24GB Ram | 1TB NVMe | Intel Graphics
Re: [SOLVED] CSS: How to wrap text around image with caption
Thank you so much !
That worked perfectly.
I was wracking my brain on this one.... it seems there are so many CSS attributes and I just couldn't find the one I needed.
Thank you again!
That worked perfectly.
I was wracking my brain on this one.... it seems there are so many CSS attributes and I just couldn't find the one I needed.
Thank you again!