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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    411
    Thanks
    119
    Thanked 0 Times in 0 Posts

    footer centering problems

    how come the text in my footer div is NOT centered on this page: http://www.anneroselli.com/index1.html, but is on all the rest of the pages of the site: http://www.anneroselli.com/appearances.html, http://www.anneroselli.com/news.html, etc...

    thanks!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,739
    Thanks
    22
    Thanked 1,837 Times in 1,821 Posts
    Hello sixrfan,
    Your float is not cleared and it's margin is extending into your footer and moving your xxx over.
    Try clearing the floats like this -
    Code:
    #content {
    	margin: 0px;
    	padding: 5px;
    	width: 890px;
    	min-height: 415px;	
    overflow: auto;
    }
    Removing the bottom margin also works -
    Code:
    	
    #smile {
    	background-image: url(pics/anne_smile.jpg);
    	background-repeat: no-repeat;
    	clear: left;
    	float: left;
    	height: 314px;
    	margin: 10px 0 0;
    	padding-right: 5px;
    	width: 216px;
    }
    Removing the bottom margin is just to show you what's going on. The correct way to fix this is to clear your floats.
    Have a look at this page that explains how overflow:auto; clears floats for you.
    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

  • Users who have thanked Excavator for this post:

    sixrfan (10-29-2009)


  •  

    Posting Permissions

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