centering a website

Discussion in 'HTML & Website Design' started by spiky1471, Apr 9, 2008.

  1. #1
    well im setting up a website

    www.fitness-freakz.com

    template is dumped on site but no alterations made

    how do i make the website be centered - like in the middle of the page
    as it looks rubbish on the left

    and i know its not the best website template but w/e
     
    spiky1471, Apr 9, 2008 IP
  2. Xezor1324

    Xezor1324 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <div align="center">
    </div>
    Around your table that hold the content.
     
    Xezor1324, Apr 9, 2008 IP
  3. EnPassant

    EnPassant Active Member

    Messages:
    612
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    70
    #3
    It seems like a <table> design, maybe

    <table width="766" align="center" border="0" cellpadding="0" cellspacing="0"><tr><td>

    Your content html is put here.

    </td></tr></table>
     
    EnPassant, Apr 9, 2008 IP
  4. spiky1471

    spiky1471 Peon

    Messages:
    826
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks ive got it centered just a few tweaks it should be ok
     
    spiky1471, Apr 9, 2008 IP
  5. dazw1

    dazw1 Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    the div's will do it
     
    dazw1, Apr 9, 2008 IP
  6. Trapped

    Trapped Well-Known Member

    Messages:
    1,832
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    130
    #6
    for tables the example above should work just fine. If you go with divs I would work out the CSS (div.center { margin:0 auto; }) applying margin:0 auto will center the layout but not the text.
     
    Trapped, Apr 9, 2008 IP
  7. kevster1

    kevster1 Peon

    Messages:
    747
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i always use the wrap

    #wrap {
    width: 760px;
    margin: 0px auto 0px auto; /* top, right, bottom, left */
    padding: 10px;
    border: 1px solid #000;
    background-color: #eee;
    }

    then place the content inside <div id="wrap">

    works a treat
     
    kevster1, Apr 9, 2008 IP
  8. Alex Fraiser

    Alex Fraiser Banned

    Messages:
    75
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    That is my preferred way to do it as well. :)
     
    Alex Fraiser, Apr 9, 2008 IP
  9. instamatic

    instamatic Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks for the help guy's, i also had this problem and now its sorted. thank again
     
    instamatic, Apr 10, 2008 IP
  10. melon

    melon Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Actually it doesn't really matter whether the layout uses tables or divs, the previously mentioned <div style="margin: 0 auto;">content</div> will work fine.
     
    melon, Apr 10, 2008 IP