Is there a way to make a div responsive like an image in CSS? For example, if I have an image sized at 800px x 400px and set its width to 100%, it will automatically resize to fit the full width of the screen on a desktop (width: 1400px) to become 1400px x 700px. However, for a div element I must set both the width and height specifically. Is there a method to set an empty div with a width of 800px and height of 400px, that will then resize proportionally depending on the screen size, while still maintaining its ratio like an image?
Any insights would be appreciated.