I am looking to create a rectangular shape using a specific height-to-width ratio of 30:50. The rectangle should occupy 40% of the screen width. How can I adjust the height while maintaining this ratio when resizing the screen?
HTML:
<div id="bg">
</div>
CSS:
#bg {
background-color: blue;
width: 40%;
}