<body style="min-height:2000px;">
<div id="test" style="position:relative;bottom:0;">
some dynamically changed content
</div>
</body>
What do i expect:
-If #test
height is greater or equal to body's it should stick to bottom (as it happens now cuz of block model)
-If #test
height is less than body's it should however stick to bottom, having white space above it. (which doesn't happen, #test
doesn't stick to bottom).
-Using position:absolute is not acceptable as then #test
will not influence body height when #test
is higher than body.
-Using position:fixed is not acceptable as then #test
will stick to bottom of window, not body.
Q: Can I get what I expect using css only? How?
Sorry for poor English, however I think the question is easy to understand.
Thank you.
P.S.: I need that in css because some dynamically changed content is changed via js and I want to avoid recalculating #test
div position each time it changes.
UPD:
I've also tried some display:inline-block; vertical-align:bottom;
stuff still no result.
UPD2:
Thank you guys, still it seems, that easiest way is just to add a couple of lines to my javascript to recalculate body height on #test
height change.
min-height: 2000px;
? Is this higher than your screensize? – Nucleoproteinposition: absolute or fixed
to#test
and giveposition: relative
tobody
tag. that will fix for sure. – Cofield