SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Aug 2006
    Location
    Washington DC
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page Not Centering

    Hey guys!

    I need some quick help here. Silly issue, but I can't seem to get this site here to be centered in any browser except IE6. I can't seem to get it to center. Much appreciated!

    Thanks,
    Eric Huang
    Erichuangis: Erichuangis.com
    Small Blogs Network: Small Blogs Network

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Location
    San Diego
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would change

    Code:
    .centered { width: 1000px; }
    to:
    Code:
    .centered { width:960px !important; }
    This works for me in firefox

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,176
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Forget about align="center" and align="left". Trust me, this is totally out of date.

    Firstly, give that main wrapping div an id, such as #wrapper:

    Code:
    <div id="wrapper">
    
    </div>
    Then in your CSS, place this:

    Code:
    #wrapper {
      width: 960px;
      margin: 0 auto;
    }
    The auto left and right margins are what center the layout.

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,598
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Hi, the page is centering for me in IE6
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  5. #5
    SitePoint Enthusiast jnicol's Avatar
    Join Date
    Jul 2006
    Location
    Melbourne, Australia
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree 100&#37; with ralph.m. You should be using CSS to control alignment.

    However, if you wish to proceed with your current method, set the width attribute of the div that wraps your main div to the correct width of its content, which is 960px, not 620px.

  6. #6
    SitePoint Addict
    Join Date
    Aug 2006
    Location
    Washington DC
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys! Those suggestions work.
    Erichuangis: Erichuangis.com
    Small Blogs Network: Small Blogs Network


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
  •