SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Off-Center

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Off-Center

    Hello!

    I'm not exactly sure why, but everything is centered on my webpage except for the footer.

    You can find my website at myalgebrabook.com. And, my css is located at:

    http://www.myalgebrabook.com/css/chapters.css

    Any help would be appreciated.

    Thank you,

    Eric

  2. #2
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe it's because of the margin-left in here:

    Code:
    div#footer{
    	text-align: center;
    	margin-left: 192px;
    	width: 960px;
    	padding: 10px 0;
    	background: #333;
    	color: #FFF;
    	position: relative;/* this gives IE6 hasLayout to properly clear */
    	clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
    }

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick response! I changed it as suggested and it worked on the homepage. In fact, I was trying to figure out why the heck I even had it there. But, then if you go to the "Free Sneak Peak" link on the top left-hand side...you'll see that now the footer is all the way to the left. I fear then, that it's a fix for the homepage but not for the "inside" of the site. If you have any other interesting ideas, I'm all ears.

    -Eric

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,389
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    On the Free sneak page the footer is not inside #container as you seem to have an extra closing div above it. If you remove one of the closing divs above the it should right itself.

    However you need to tidy that page up and get it validated as you have ,links to stylesheet in the body of the html and they should be in the head. You have scripts mingled all through the code and most don't need to be there especially the jquery ones.

    There are other odd tags spread around the place like this.

    Code:
                        </ul>
                </ul>
                <table width="100" border="0" cellspacing="0" cellpadding="0">
    You have self closed some tags and not others:

    Code:
    <script type="text/javascript" src="../../js/pullquote.js"/>
    <script type="text/javascript" src="../../js/jquery/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>
    The script tag isn't a self closing element anyway.

    Stylesheets should be in the head and not here:
    Code:
        <div id="navigation">
            <div id = "nav_left">
                <link rel="stylesheet" media="screen" href="/css/superfish.css" />
                <link rel="stylesheet" media="screen" href="/css/superfish-vertical.css" />
    Are you using all those Google fonts? If not remove them as you don't want to waste time downloading them all. If you need a few of them then separate the font name with a pipe character as mentioned in the documentation to avoid multiple css files.

  5. #5
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much for your reply to my post and especially for all of the additional info that you supplied. I look forward to fixing the centering issue when I get home later.

    Also, I'm headed into the tail end of this project (my first big web project) and most of my focus has been on overall site structure and functionality; now I'm trying to fix things that don't look right. And, I most definitely want to have clean code as an important "iicing on the cake".

    Anyway, I think that most of my extra tags and misplaced style info can be quickly fixed since they're just included php files. And, you've given me some important issues that I do need to address.

    Cheers!

    -Eric


Bookmarks

Posting Permissions

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