here is my code
<div class="entry-content"> <p>some text...</p> <p>some text...</p> <p>some text...</p> </div>
My entry-content div has an absolute positioning, so the text inside the p tags goes under the footer. i have to fix the height of entry-content to total height of all p tags using javascript.
please help.
Have you tried using
$('.entry-content').height(), or similar functions like.innerHeight()? (jQuery docs).You wouldn’t need to set the height of the
<div>, but you could measure the default height, and use that to position your footer.A word of warning: because of text wrapping, the height of that div might change when the window is resized. You might want to set a callback using
$(window).resize(...), to update the positioning when that happens.