I am trying to create a masonry grid like structure with images. More specfically, I am rendering a list of <figure>
elements with <img>
and <figcaption>
children elements. However, when I display the data in the browser, the image and figcaption separate.
I am using Tailwind CSS for styling.
Why is this the case and how can I fix it?
I've tried using flexbox and grid, but they 1) weren't as precise as plain columns and 2) didn't achieve what I wanted anyways
Here is the codepen link