This is the demo page for JSRatio, a tiny aspect-ratio enforcing library. You can also view the page source for more info about the demo.
Try resizing the browser window to see if the ratio remains the same.
<div style="width: 50%;" data-js-ratio="1.5">1.5</div>
<div style="height: 300px;" data-js-ratio="0.5">0.5</div>
<div style="width: 50%; height: 200px;" data-js-ratio="1.5" data-js-ratio-width>1.5</div>
<div style="width: 50%; height: 200px;" data-js-ratio="0.5" data-js-ratio-height>0.5</div>
<script>JSRatio.init();</script>