realtimethrill
11-30-2008, 04:15 AM
Hi
I'd like some text to sit at the bottom of its containing element (which has fixed dimensions). When the text is added to via JavaScript such that it stretches upwards into otherwise empty space and overflows the element, a vertical scroll bar should appear.
Visually speaking: a block of text should appear in an enclosing box with the bottom edge of the text against the bottom of the box. Should the text become too large for the box, the beginning of the text should be visible and a scroll bar should appear to make the end of the text revealable.
The best I've come up with is a two element solution:
<div style="height: 50px; width: 70px; overflow: auto; position:absolute; border:solid;">
<span style="position:absolute; bottom:0px;" >8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 </span>
</div>
The text sits nicely at the bottom of the parent div, but when it's as long as that above, the overflow is hidden and a scroll bar does not appear.
I've tried a display-table type solution with no success.
Any thoughts much appreciated!
I'd like some text to sit at the bottom of its containing element (which has fixed dimensions). When the text is added to via JavaScript such that it stretches upwards into otherwise empty space and overflows the element, a vertical scroll bar should appear.
Visually speaking: a block of text should appear in an enclosing box with the bottom edge of the text against the bottom of the box. Should the text become too large for the box, the beginning of the text should be visible and a scroll bar should appear to make the end of the text revealable.
The best I've come up with is a two element solution:
<div style="height: 50px; width: 70px; overflow: auto; position:absolute; border:solid;">
<span style="position:absolute; bottom:0px;" >8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 </span>
</div>
The text sits nicely at the bottom of the parent div, but when it's as long as that above, the overflow is hidden and a scroll bar does not appear.
I've tried a display-table type solution with no success.
Any thoughts much appreciated!