I have a div I would like to mantain aspect ratio 2:1 no matter the screen size and ratio are.
This is my choice (discarding other previous options)
.mydiv{
background-color: red;
width: 100%;
position: absolute;
height: 50%;
}
<div class="mydiv">
this should be a fixed aspect ratio div
</div
I tried media queries and this: https://www.w3schools.com/howto/howto_css_aspect_ratio.asp but it is not what I'm looking for because of the white padding space