Setting div height based on its width
You can do this with CSS by setting the height to zero and then adding a percentage to padding-bottom. You might have to tweak it a little to get the desired outcome but here's a fiddle with an example http://jsfiddle.net/wbq8o3s7/
#myDiv {
width: 100%;
height: 0;
padding-bottom: 35%;
background-color: #333;
}
<div id="myDiv"></div>