I have a fixed width and height div where I want to include an image with a caption (using img and figurecaption) without exceeding the parent's dimensions.
Here is what I attempted: `
parent->
height: 100px;
width: 100px;
margin: 0;
img->
display: block;
height: 100%;
width: 100%;
figurecaption->
text-align: center
`
However, when the image is larger than the specified height and width, the caption overflows. How can I prevent this from happening? Thank you.