Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    My sticky footer is working great, but I'm having a problem with my container div extending to the footer on short pages. I know where the problem is, I think, but I can't seem to fix it.
    My footer image is wider than the container, and my container has a right/left border. The footer image incorporates the border so it looks seamless. I realized at one point that if you shrink the browser window, the footer image and container would misaligned due to the size difference. My solution was to put a second container around the first container with the border and make it same width as the footer.
    I thought it was perfect, working great. I just changed my footer image, and made it a tad taller. I went and adjusted my footer height for the new image and when I was testing it out, I realized the original container was not extending to the footer, leaving a gap between the border and the footer. Not so seamless.
    My container has a height of 100% and I even had it with min-height 100% but it still doesn't extend.
    Should I dump the second container and not worry about the footer becoming misaligned when the window is shrunk? Can this just be fixed? I don't know what else to try.

    Code:
    #container2 {
        width: 900px;
        margin-top: 0px;
        margin-right: auto;
        margin-bottom: 0px;
        margin-left: auto;
        min-height: 100%;
        padding: 0px;
    }
    
    #container {
        min-height: 100%;
        background-color: #FFF;
        border-right-width: 1px;
        border-left-width: 1px;
        border-right-style: solid;
        border-left-style: solid;
        border-right-color: #000;
        border-left-color: #000;
        position: relative;
        width: 800px;
        margin-right: auto;
        margin-left: auto;
        text-align: left;
        padding: 0px;
        margin-top: 0px;
        margin-bottom: 0px;
    }
     
    <body>
    <div id="container2">
    <div id="container">
    <div id="pageheader">
      <div id="header"></div>
    </div>
    <div id="navbar">
    <ul>
    <li class="small"><a href="index.html">Home</a></li>
    <li class="mid"><a href="price.html" id="current">Pricing</a></li>
    <li class="large"><a href="photos.html">Portfolio</a></li>
    <li class="small"><a href="faq.html">FAQ</a></li>
    <li class="mid"><a href="map.html">Find us!</a></li>
    <li class="large"><a href="contact.html">Contact us</a></li>
    </ul>
    </div>
    <div id="main">
    </div>
    </div>
    </div>
    <div id="footer">
    <div id="foot">
    </div></div>
    
    </body>

  2.  

  3. #2
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    It's extremely hard to understand what your talking about without something visual for us. Can you upload a screenshot with like arrows or something? Maybe also upload it to a test host for us to see what we are dealing with. (we being people on the forum)
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  4. #3
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    Quote Originally Posted by Andrew Yurlov, post: 248886
    It's extremely hard to understand what your talking about without something visual for us. Can you upload a screenshot with like arrows or something? Maybe also upload it to a test host for us to see what we are dealing with. (we being people on the forum)
    Here's what it looks like.
    I think a more simple explanation is, my child div is not extending 100%!

    http://imageshack.us/photo/my-images/195/26642212.png/

  5. #4
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    Well I don't see the problem in your code right now. I'll have to upload it to my own host and play around with it to see what is wrong. I'll get back to you as soon as I do.
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  6. #5
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    Did like 20 different searches and found something that seems to work! I set the bottom padding on container to 10080 and the bottom margin to -10000 (80 is the height of the footer) and container2 has overflow hidden.

    I previously had another div to provide padding between the page content and footer, but when I implemented this solution, it became too much and I got rid of it that.

  7. #6
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    Whoa those are some big numbers. Doesn't seem right to me...
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  8. #7
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    Well, those numbers can be anything large and it is supposed to work. If someone had a screen resolution taller than 10080 px, it'd have the gap! The container extends that far, but since overflow is hidden, it doesn't expand the page that far. I should have thought of that... Part of the way the sticky footer works incorporates the same idea somewhere. I suppose I could do 99999 and -99919 even.

  9. #8
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Could it be that the browser is setting a default margin or padding ? Have you started your CSS with a reset to eliminate this?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  10. #9
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    A reset?

    I have 0 padding and margin set on everything.

  11. #10
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Well, since we can't see the code ....

    Tough to troubleshoot a code issue with a picture... I can give you a list of 20 things that could cause the effect showing in the image... But it would be 20 guesses... Which I don't waste my time with


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:57 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com