Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2012, 07:13 PM   PM User | #1
MTWK
New Coder

 
Join Date: Sep 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
MTWK is an unknown quantity at this point
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?
MTWK is offline   Reply With Quote
Old 11-06-2012, 07:35 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Old 11-07-2012, 12:09 PM   PM User | #3
MTWK
New Coder

 
Join Date: Sep 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
MTWK is an unknown quantity at this point
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..
MTWK is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:13 AM.


Advertisement
Log in to turn off these ads.