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 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Centering a footer

    I have tried everything I know to get the footer centered on the page AND staying centered when you resize the page.

    http://www.wheelockpartners.com/

    Any suggestions?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello MTWK,
    To center an element you need three things:
    1. a valid DocType
    2. an element with a width
    3. that elements right/left margins set to auto



    You have some other issues to consider first though.
    • Your footer, #colophon, is 100% wide so it cannot be centered.
    • Inside #colophon, you have #supplementary which is 100% wide PLUS 250px (your 125px left/right padding).
    • In #supplementary, you have #'s first, second and third which you probably want to look like 3 columns.

    Your best bet would be to figure out how wide #supplementary is and center that element.
    For more information on how the padding in that element is breaking your layout, see the box model here. The box model says that whatever you put inside an element cannot be larger than that element. margin/padding/border all count when figuring width/height.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. I didn't write the code - just trying to work with it. Thanks for the direction. Got it working.
    Last edited by MTWK; 11-07-2012 at 12:26 PM.


  •  

    Posting Permissions

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