I’m trying to align images that have text underneath side by side. I have been trying to do this for a while now but I can’t seem to do it. Can anyone please help?
So far, I was able to get images to be right next to each other (inline) but the captions of the image (which I want to be underneath the image) is actually to the immediate right of the image (which is not what I want).
It’s hard be specific without seeing your code but the point here is to pick the right elements, and HTML structure, for the job.
So, you want the images and captions to stay together…then we need to wrap them in something…a div will do although I prefer a figure ..and the text could be any text element but again, the figure has it’s own element for this…a figcaption.
So, if we use that you can then use any technique you want to get the wrapping elements to shrink-wrap around the image and associated caption…I prefer display:inline-block but floating works too…and nowadays flexbox get’s it done as well.