I am facing an issue with resizing the slider I have on my website. Currently, it is set at 1200 x 400 pixels, and while the width adjusts correctly when the page is resized, the height remains fixed at 400px. I would like the height to resize proportionally to the width of the image when viewed on smaller devices.
How can I achieve this?
When viewed on a phone, the slider appears as follows:
https://i.sstatic.net/xl33m.png
The current CSS for the image is:
max-width: 100%;
height: auto;
Here are some solutions I've attempted:
Setting the height to 33.3% (with
html
,body
, and#container
set towidth: 100%
)Trying various settings with
vh
andvm
, but they did not produce the desired effect
Additionally:
I am utilizing Bootstrap 4, so if there is a specific Bootstrap class that can help solve this issue, that would be ideal.
You can also view a live version of the site at