Today I want to show you how to do that by CSS.
Firstly, Create Div structure like below:
This is your div with the specified aspect ratio.
Then we are going to set aspect ratio of main div to a specific one by following CSS statements:
/* whatever width you want, depends on your purpose */
/* this is the key thing, the percentage value is converted from 16:9 ratio. So you can set it to any aspect ratio you want ex: 4:3 = 75% */
/* fill parent with color */