Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bottom positioning with CSS

Status
Not open for further replies.

baybook

MIS
Sep 16, 2004
66
US
I'm looking through the old posts and from what I'm reading it looks like there is now way to position a footer to ALWAYS be at the bottom of a page unless the page is a static length.

Is this correct? The headers(top of page)

I have taken out my position:absolute in the footer and the layer that is holding everything, but then everything moves to the top.

Please advise. Thanks!! Here is a snippet of the stype sheet.

_____________________________
.footer{
position:absolute;
text-align:center;
background-image:url(images/bk_space.jpg);
bottom:10px;
width:710px;
left: 0px;
}

.secondheader{
position:absolute;
left: 0px;
width:710px;
height:39px;
top:100px;
}
.header{
position:absolute;
width:710px;
height:100px;
left: 0px;
top: 0px;
}

.container{
height:425px;
width:710px;
left:10px;
top:0px;
position:absolute;
z-index:1;
}
 
This is a gamble.

position:absolute;
top:expression(document.body.offsetHeight);

--Glen :)

Memoria mihi benigna erit qui eam perscribam
 
If I'm not mistaken expressions and javascript in CSS only works in IE. Please let me know if I'm wrong - as it would greatly help me reduce code on my site.

But I think the easiest way to keep a footer at the bottom of the viewing window would be absolute positioning. Your code:
Code:
.footer{
position:absolute;
text-align:center;
background-image:url(images/bk_space.jpg);
bottom:10px;
width:710px;
left: 0px;
}
looks pretty good. From what I see it looks like the footer would rest at 10px from the bottom, all the way to the left of the screen with a width of 710px.

If you want it to be at the absolute bottom of the page try changing the bottom:10px to bottom:0px.

I have a bottom footer like this on my site. You can use that code if you like. It's at
Good luck with the footer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top