I am trying to have a two row hierarchy display for some photos using bootstrap 5. However, rather than staying within the container the images overflow out. I want the container to fill the screen so that it acts as a cover display without the user having to scroll. How can I make them dynamically resize to fit the container?
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="container" style="height: 100vh; background-color: yellow;">
<div class="row justify-content-center">
<div class="col col-12 col-md-4">
<img class="w-100 p-5" src="https://via.placeholder.com/1080" style="border-radius: 80px;">
</div>
</div>
<div class="row">
<div class="col col-12 col-md-4">
<img class="w-100 p-5" src="https://via.placeholder.com/1080" style="border-radius: 80px;">
</div>
<div class="col col-12 col-md-4">
<img class="w-100 p-5" src="https://via.placeholder.com/1080" style="border-radius: 80px;">
</div>
<div class="col col-12 col-md-4">
<img class="w-100 p-5" src="https://via.placeholder.com/1080" style="border-radius: 80px;">
</div>
</div>
</div>
The elements are overflowing like this:
I want it to instead scale down the images to look like this:
I tried setting a set height on the elements, but then they take up the whole screen as if the height is not defined relative to the container. Is there some different method I can use to display the images so that they change dynamically?