Re: Clip Overflow, Vertical-Align Bottom...how do I do this?



On Jul 3, 3:30 am, Ben C <spams...@xxxxxxxxx> wrote:
On 2007-07-03, BeeRich <beer...@xxxxxxxxx> wrote:

Hi folks.

Question for the gurus.

I have a box 200 wide, 200 tall. I insert text in there and it's
larger than the box. So I set overflow to hidden. The result is
text
that starts at the beginning, and the end of the paragraph is sliced
off at the end.

How do I shove this vertically, so that the beginning is cut off, and
the last parts of that text are shown, aligned to the bottom? The
length of this text will change, so I need a way of aligning it so
that the top part becomes hidden, not the bottom.

Use absolute positioning to put one box inside another and to align the
inner box with the bottom of the outer one. If you leave top and height
auto on the inner one, it will get its content height and overflow its
container upwards.

<style type="text/css">
#container
{
position: relative; /* so it's containing block for contents */
height: 100px; /* Or use 200px obviously */
width: 200px;
background-color: palegreen;
margin-top: 200px; /* just so we can see the top clearly */
overflow: hidden;
}
#contents
{
position: absolute;
bottom: 0; /* align it to bottom of container */
font-size: xx-large;
/* We leave top and height as auto */
}
</style>

...

<div id="container">
<div id="contents">
1 blah<br>
2 blah<br>
3 blah<br>
4 blah<br>
5 blah<br>
</div>
</div>

Ah it worked. Now to apply it to my real application.

Cheers

.



Relevant Pages

  • Re: Clip Overflow, Vertical-Align Bottom...how do I do this?
    ... So I set overflow to hidden. ... that the top part becomes hidden, not the bottom. ... inner box with the bottom of the outer one. ... container upwards. ...
    (alt.html)
  • Re: Pop up div with grayed out background
    ... being absolutely position at zero. ... Specifying all of top, bottom, left and right as 0 will make it stretch to fit its positioning parent in a standards-compliant browser. ... You will see the content because it will break out when at the default overflow of "visible" ... You will see no red text but no yellow background with overflow hidden ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Layout inconsistent between modern browsers
    ... Forget about the overflow for a moment, browsers do differ in the more ... take the bottom of the text as sitting on the inline line. ... You can set heights on ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: CSS formatted links not working <6c5c6bce-6a40-4dc6-aa05-696ec9ec7ca3@j22g2000hs
    ... I find having to scroll sections of a page ... content div and not overflow out the bottom of it. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Can I use same overfloow for sump and closed-loop ?
    ... Most overflows are rated for certain flow rate and in most ... in the bottom of the tank DIFFERENETLY than the original intend... ... If your overflow is rated at 600GPH, ... sump bubbles raise to the surface, ...
    (rec.aquaria.marine.reefs)