As a beginner in HTML, I am currently facing an issue while trying to display a set of pictures. My goal is to resize the pictures based on the current window size while maintaining the aspect ratio. Despite experimenting with various methods like using width: auto and height: auto, I have not been successful in achieving the desired result. The closest I got was adjusting the picture size on the x-axis, but this resulted in cutting off the images on the y-axis. I aim to ensure that the entire content fits within the window size at all times, and I also want to arrange 5 pictures side by side.
.image {
position: top-left;
object-fit: cover;
height: 19%;
width: 19%;
}
<div id="container">
<img class="image" src="https://www.lkz.de/cms_media/module_img/2197/1098748_2_detailbig_5f52b830aced9.jpg">
<img class="image" src="https://www.lkz.de/cms_media/module_img/2197/1098748_2_detailbig_5f52b830aced9.jpg">
<img class="image" src="https://www.lkz.de/cms_media/module_img/2197/1098748_2_detailbig_5f52b830aced9.jpg">
<img class="image" src="https://www.lkz.de/cms_media/module_img/2197/1098748_2_detailbig_5f52b830aced9.jpg">
<img class="image" src="https://www.lkz.de/cms_media/module_img/2197/1098748_2_detailbig_5f52b830aced9.jpg">
</div>