I need help making these 2 images displayed side by side, and I want the text to be underneath the images not beside it. the problem even when I make these two images display one beside one for some reason the caption come on the right of each image. Any help would be greatly appreciated. Thank you.
HTML:
<div class="container">
<figure id="img-div1">
<img id="image1" src="https://www.wearethemighty.com/app/uploads/legacy/assets.rbl.ms/17317425/origin.jpg" alt="Sadam husain In his reign" style="width:50%" background-size="cover">
<figcaption id="img-caption">
A drawing for Sadam husain represents the period of his reign.
</figcaption>
</figure>
</div>
<div class="container2">
<figure id="img-div2">
<img id="image2" src="https://arc-anglerfish-arc2-prod-advancelocal.s3.amazonaws.com/public/MIE5YDG625EFNGPHMVLSL3JDKM.jpg" style="width:40%" align=flex background-size=cover>
<figcaption id="img-caption">
Sadam husain inside the court.
</figcaption>
</figure>
</div>
CSS:
.container {
display: inline-flex;
}
img {
max-width: 200%;
height: auto;
margin: 0 auto;
display: flex;
justify-content: center;
}
#img-div1 {
background: white;
padding: 5px;
margin: 0;
display: inline;
}
#img-div2 {
background: white;
padding: 5px;
margin: 0;
display: flex;
float: inline;
}
#img-caption {
margin: 10px 0 5px 0;
}
b @media (max-width: 460px) {
#img-caption {
font-size: 1.4rem;
}
}