3 replies [Last post]
Aequitas
Aequitas's picture
Offline
Enthusiast
PA
Last seen: 9 years 36 weeks ago
PA
Timezone: GMT-4
Joined: 2007-09-13
Posts: 246
Points: 2

On www.glemser.com ( for instance ) you can see, if your viewport is >970px high, that it gets cut off and looks, somewhat ugly. What I'd ideally like to do is set a height of the container ( that has the white background ) so that it flows to the end of the viewport height, even when the content is not that tall. Is this possible to do without JS or specifying it page by page?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 day 10 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9774
Points: 3856

Print thing on the web

That's kind of a print thing. The web is not print. A web page does not have an explicit height; it's as high as it needs to be.

If you just must do this thing, take a look at this footer stuck to the bottom demo*. You should be able to adapt it to your needs—screwy though they are. Laughing out loud

cheers,

gary

* That I made the demo does not imply my approval of its use. Wink

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Aequitas
Aequitas's picture
Offline
Enthusiast
PA
Last seen: 9 years 36 weeks ago
PA
Timezone: GMT-4
Joined: 2007-09-13
Posts: 246
Points: 2

Yeah, I'd rather avoid it,

Yeah, I'd rather avoid it, but don't you think it looks a little dumb to have it just cutting off like that? I suppose we could make some sort of a rounded cap, but I'd rather just do this I think.

Thanks a lot for the link - I should've checked your site before posting... Smile

Actually, that will work great for a liquid layout, but this is static, and as such, without browser sensing I don't think it will help since the content needs to be centered. No way to center ( automatically and dynamically ) and position absolutely, is there?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 day 10 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9774
Points: 3856

#main { height: auto;

#main {
    height: auto;
    padding: .5em;
    padding-bottom: 3em;   /*Keeps content above footer. Originally
                           used margin, but a bug in Opera7 seemed
                           to add spurious margin, pushing the
                           footer beyond the viewport even with
                           short content. */
    width: 85%;
    margin: 0 auto;
    }

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.