Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Maybe simple div/css question.

    And I have a link for you guys to look at: http://tamashiiltd.com. Now, for the explanation.

    I have two divs, one "container" and one "footer"..I have them aligned as I would like with container centered in the browser and footer spanning the page, but what I want is for the footer to be at the foot of the page rather than how it is right now. As it stands now, my container div scales to 100% in the vertical and pushes my footer below the browsers height therefore forcing the user to scroll even when there isn't any content in the "container" of the page. Anyone have a css solution to this? thanks.

  • #2
    Regular Coder
    Join Date
    Oct 2007
    Location
    Glencoe, Ontario, Canada
    Posts
    340
    Thanks
    19
    Thanked 27 Times in 27 Posts
    Try using a sticky footer bud.

    http://www.cssstickyfooter.com/
    Eric "PitbullMean" Melo
    Always Start your layout with*{border:0; margin:0; padding:0;}
    Be sure to Thank ALL Users who give assistance.

  • Users who have thanked PitbullMean for this post:

    mack10 (08-09-2010)

  • #3
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Wow its like that code was written just for me :P. Thanks for that - now I actually have another question. see link: http://tamashiiltd.com/testingdivs.htm.

    This time I have a "body" div nested inside the "container" div - as you can see, when I scale the "body" div past the "container" div's height, it just overlaps its edge and doesn't automatically adjust the container div, what I would like is for the "container" to scale automatically when I manually scale the body div - (css height: auto - doesn't work). I scaled the container div to 400px and the body div to 500px for illustrative purposes. Any fix or workaround to this? should I not be nesting divs inside divs? what's a good alternative? thanks.

  • #4
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    useful link PitBullmean but I disgree with one point in it.

    just about the CSS paragraph he wrote:
    Code:
    If you wanted to place any elements outside of either the wrap or the footer then you would need to use absolute positioning else it messes up the 100% height calculations.
    If you have more elements to add, put them all inside a container and keep the footer in its own container beneath the main one. if themain one shriknks from page to page as determined by more or less content, the footer will always ride up. if the content of the main container is very short, you may see the footer too 'high' in which case, you may need to position it absolutely to the bottom of your viewport.

    My point was simply that it seemed to me the writer of that article was suggesting a jump to absolute positioning before it is needed. that siad, there are several much more proficient CSS'ers here than me so I amy stand corrected. Just don't rush into absolute positioning. It can wreak havoc with x-browser support.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #5
    Regular Coder
    Join Date
    Oct 2007
    Location
    Glencoe, Ontario, Canada
    Posts
    340
    Thanks
    19
    Thanked 27 Times in 27 Posts
    @bazz, that code has been tested across the board on all browsers so he wont have to worry about havoc.
    Eric "PitbullMean" Melo
    Always Start your layout with*{border:0; margin:0; padding:0;}
    Be sure to Thank ALL Users who give assistance.

  • #6
    Regular Coder
    Join Date
    Oct 2007
    Location
    Glencoe, Ontario, Canada
    Posts
    340
    Thanks
    19
    Thanked 27 Times in 27 Posts
    @mack10, Maybe this link will help you with your problem http://www.netmechanic.com/news/vol7/css_no8.htm
    Eric "PitbullMean" Melo
    Always Start your layout with*{border:0; margin:0; padding:0;}
    Be sure to Thank ALL Users who give assistance.

  • Users who have thanked PitbullMean for this post:

    mack10 (08-09-2010)

  • #7
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by PitbullMean View Post
    @mack10, Maybe this link will help you with your problem http://www.netmechanic.com/news/vol7/css_no8.htm
    That is a helpful link thanks you once again. However, I don't think it'll solve my problem, I guess I'll just manually scale the container div in the vertical direction to what I need although that doesn't seem ideal.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •