You donβt need to complicate this too much - you donβt need to look for a way to apply height to the CSS class. Just give each class <div>a in HTML:
<div class="viewport_height">This is some content.</div>
then use jQuery code like this:
var document_height = $(document).height();
$('.viewport_height').css('height', document_height + 'px');
apply measured height to all elements of this class.
For a more reliable solution, attach the function to the event window onresizeto recalculate and apply the height when changing the height of the viewport.