Centering a site?

Discussion in 'HTML & Website Design' started by sam2698, Oct 15, 2006.

  1. #1
    How do I center a site perfectly?
     
    sam2698, Oct 15, 2006 IP
  2. Revamped Solutions

    Revamped Solutions Active Member

    Messages:
    1,347
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Center your website in the:

    
    <div align="center">
    <body>
    site stuff here
    </body>
    </div>
    
    Code (markup):
     
    Revamped Solutions, Oct 15, 2006 IP
  3. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What do you mean by saying centering :) ? there is kind's of centering.
     
    Morishani, Oct 15, 2006 IP
  4. sam2698

    sam2698 Well-Known Member

    Messages:
    941
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    118
    #4
    It doesn't work :(.

    I just want it the whole site to be centered. That is all.
     
    sam2698, Oct 15, 2006 IP
  5. jacobbannier

    jacobbannier Active Member

    Messages:
    1,155
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    90
    #5
    <center>
    <body>
    </body>
    <center>
    It is the same, but that should work or you have done something wrong.
     
    jacobbannier, Oct 15, 2006 IP
  6. knightyme

    knightyme Peon

    Messages:
    59
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Centering a single HTML page can be as simple as the previous posters have suggested or it can be problematic depending on just how simple/complex your site is.

    For instance, if your site is a framed site, then the <center> tag may not work as you'll need to go in and tweak a couple of places. I-Frames can be yet another problem area and Tables seem to be the most bothersome for the uninitiated.

    Might I suggest that you post a link to your site and allow us to see the source? We might be able to better help you center it.

    :)
     
    knightyme, Oct 15, 2006 IP
  7. sam2698

    sam2698 Well-Known Member

    Messages:
    941
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    118
  8. chewbacca

    chewbacca Peon

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I prefer using CSS.
    #wrapper { margin: 0 auto; }
    Code (markup):
    <!DOCTYPE ... >
    <html>
    <head>
    ...
    </head>
    <body>
    <div id="wrapper">
    ...
    </div>
    </body>
    </html>
    Code (markup):
     
    chewbacca, Oct 15, 2006 IP
  9. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #9
    it's better to text-align:center the body and then text-align:left the wrapper, so it'll work in most (or all) of the browsers.
     
    Morishani, Oct 15, 2006 IP
  10. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #10
    I just use 1 table with everything inside it and then just use this code in the table tag

    align="center"
     
    bigrollerdave, Oct 15, 2006 IP
  11. Franck S

    Franck S Peon

    Messages:
    775
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I see that your problem is solved.

    I just have a question: Is it a free template ?

    I like the look.
     
    Franck S, Oct 15, 2006 IP
  12. sam2698

    sam2698 Well-Known Member

    Messages:
    941
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    118
    #12
    No, but I after it is completely done I am selling it for only $3.
     
    sam2698, Oct 15, 2006 IP
  13. RNelson

    RNelson Active Member

    Messages:
    864
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #13
    just put <center> before the template image :)
     
    RNelson, Oct 15, 2006 IP
  14. Franck S

    Franck S Peon

    Messages:
    775
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Thanks, Good work.

    Continue like that.

     
    Franck S, Oct 16, 2006 IP
  15. chewbacca

    chewbacca Peon

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I would include that text-align: center; in another file that only gets included for IE 6 (or any other browser that messes it up).
     
    chewbacca, Oct 16, 2006 IP