A helper to align rectangular regions in the DOM