Vertical spring spacer CSS -
i'm new here @ stack overflow. :-)
how can create div automatically change it's height space filled? i've tried with
height:"auto"
doesn't work... :(
for example:
<div style="height:300px"> <div style="height:50px">...</div> <div>the height of div varies page page...</div> <div style="height:???">sproing!!</div> <div style="height:50px">...</div> </div>
edited example match better needings.
thanks.
unfortunately there isn't pure css way since you're trying is:
spring height = parent height - n children's height
you can pretty jquery though:
markup
<div id="parent"> <div id="top">...</div> <div id="spring">sproing!!</div> <div id="bottom">...</div> </div>
jquery
var leftover = $('#parent').height() - $('#top').height() - $('#bottom').height(); $('#spring').height(leftover);
in action here.
Comments
Post a Comment