Jump to content
  • Advertisement
Sign in to follow this  
tstrimp

[web] CSS Question.

This topic is 4886 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to line up a div block to the bottom of another div block? The idea is a page container that has a fixed min-height and then to always align the footer to the bottom. I can do it now by filling up the vertical space with div blocks that have % heights that total 100% but this tends to break other things. Tim.

Share this post


Link to post
Share on other sites
Advertisement
There are several ways to stick a div to the bottom of another div. Unless I misunderstood what you want, the easiest method in this case is to put two divs inside the page container div, and assign the min-height to the first contained div.
_____________________________________
| Page container div. |
| Has no height specification. |
| _________________________________ |
| | Everything except the footer | |
| | goes here. | |
| | Specify a min-height for this | |
| | div only | |
| |_______________________________| |
| _________________________________ |
| | Footer | |
| |_______________________________| |
|___________________________________|

P.S. I'm not sure what you mean by page container, but unless it has a border or special positioning or something, the page container div is redundant in my example.

Share this post


Link to post
Share on other sites
You could have a block with a minimum height of 100% with a bottom-margin greater than the height of the footer, followed by the footer with a negative top margin.

Be aware that Internet Exploder does not support the min-height property, though it should degrade nicely.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!