I need to create a DIV where width=height, and height=100% of the viewport (which, obviously, is variable).
width=height
height=100%
In other words, a perfectly sq
You can do this with jquery (or pure javascript if you prefer).
With jquery:
$(document).ready(function(){ var height = $(window).height(); $('#square').css('height', height); $('#square').css('width', height); });