Is it possible to align an element with the bottom of the window, yet make it scrollable, with CSS o

Posted by last-child on Stack Overflow See other posts from Stack Overflow or by last-child
Published on 2010-04-22T16:48:38Z Indexed on 2010/04/22 16:53 UTC
Read the original article Hit count: 114

Filed under:
|
|

I have a design going on where I want to align the bottom of an intro paragraph with the bottom of the window, yet make it scroll with the rest of the page. So when the page opens, the visitor sees only the first paragraph (and a full screen background image, which is what I want to focus their attention on), but as they scroll they see the paragraph and the rest of the text. The height of the intro element can vary.

Right now I think I have to introduce some javascript to do this - meassure the height of the window, the height of the paragraph, and adjust top: or margin-top of the paragraph to the difference between the two values.

If there is a way to make a div have a height that corresponds exactly to the window height, and position the paragraph absolutely inside of this div, the let the rest of the text sit outside of the div, it could work... but I can't seem to make that happen with css. Any suggestions?

© Stack Overflow or respective owner

Related posts about html

Related posts about css