To make a div a square is pretty easy with CSS. You set a width, let's say 50%. Then you add a padding-bottom of the same value:
div {
width: 50%;
padding-bottom: 50%;
}
and it will stay square whenever you resize the window.
.
.
You can do this with any side ratio you want, if you want the box to be 16:9 you calculate:
9/16= 0.56
which you then multiply by the width of your element (in this case 50%(=0.5)), so:
9/16*0.5= 0.28 = 28%