Aspect ratio on a Div

Hi there,
Is there a way to set a Div element with a responsive aspect ratio? The height should always depend on the width (given by the layout properties).

The only solution is found is placing an image (with the desired AR) inside the div, but doesn’t seem a good solution…

Thanks in advance!

2 Likes

Div:

.aspect-ratio-16-9{
padding-top: 56.25%; /*  **16:9 Aspect Ratio**  */
}

Image inside a div:

1 Like