how would I center my blog?

Discussion in 'CSS' started by d0cpaul, Apr 21, 2010.

  1. #1
    If you look at my site http://www.moeseo.com/ the entire blog is pushed off to the left. I want it to be in the middle of the browser.

    Any ideas?
     
    d0cpaul, Apr 21, 2010 IP
  2. d0cpaul

    d0cpaul Member

    Messages:
    119
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Nevermind I figured it out. I added a
    margin-left:auto;
    HTML:
    and
    margin-right:auto;
    HTML:
    to the div id "wrapper" in the css.
     
    d0cpaul, Apr 21, 2010 IP
  3. d0cpaul

    d0cpaul Member

    Messages:
    119
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Never mind I figured it out. I added a
    margin-left:auto;
    Code (markup):
    and
    margin-right:auto;
    Code (markup):
    to the div id "wrapper" in the css.
     
    d0cpaul, Apr 21, 2010 IP
  4. Paweł

    Paweł Active Member

    Messages:
    210
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    It's a good practice to add a CSS:
    
    body {
    text-align:center
    }
    #wrapper {
    margin: 0 auto;
    text-align:left
    }
    Code (markup):
    It's a cross-browser fix.
     
    Paweł, Apr 21, 2010 IP
  5. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Do we really need to keep using that text-align trick now? I think it only applies for IE6 in quirks mode and also lesser IE versions.
    As long as the page has a doctype that keeps IE6 in standards mode, why bother using that trick?
     
    Cash Nebula, Apr 21, 2010 IP
  6. stoneRide

    stoneRide Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    just use
    <code>
    margin: 0 auto;
    </code>
     
    stoneRide, May 6, 2010 IP
  7. aprillins

    aprillins Greenhorn

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    in html
    
    <html>
    <body>
    <div id="wrapper">your content here</div>
    
    Code (markup):
    to make sure, add these css to #wrapper

    border:1px solid #333333;
    width:600px;
     
    aprillins, May 6, 2010 IP
  8. Renejr818

    Renejr818 Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    margin: X auto;

    x = whatever number you specify for the top and bottom margin
     
    Renejr818, May 7, 2010 IP