Imagine I have this image with a 4:3 aspect ratio and dimensions of 640x480:
https://i.sstatic.net/p4xRM.jpg
Here is the code used to display it:
<img src="../static/images/image4-3.jpg" class="img-fluid" alt="">
Now, I want to display it in its real aspect ratio of 16:9 (dimensions are 640x360):
https://i.sstatic.net/p1rd9.jpg
The calculation shows that for 16/9=1.77777777778 => 640/1.77777777778 = 360. Setting a style with "height: 360px" and "width: 100%" works, but it's not responsive. Is there a way to dynamically adjust the height of an image while maintaining responsiveness using bootstrap?
Just starting out with CSS, so forgive me if this is a basic question.