How to make site center for all the resolutions?

Discussion in 'HTML & Website Design' started by georgechristodoulou, Nov 26, 2006.

  1. #1
    Hi everybody,

    Let´s see if somebody can give a hand with this...

    I built a site few months ago. I designed the site to be seen on a 17 inches screen (1024x768) and looks all right with that resolution but I have now realised that my site doesn´t appear centered with a 600x800 resolution or with the resolution for a 19 inches screen.

    This is a big problem for me. Is there any way I can make my site centered for all the different screens and resolutions?

    Please I would really welcome a hand...

    Thanks to everybody in advance.
     
    georgechristodoulou, Nov 26, 2006 IP
  2. BILZ

    BILZ Peon

    Messages:
    1,515
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #2
    im an HTML noob but cant you just use the <center> tag wrapped around all the content?
     
    BILZ, Nov 26, 2006 IP
  3. watchintv

    watchintv Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you are using a stylesheet, you can center it this way:

    body {
         margin: 0 auto;
    }
    HTML:
    If you aren't using one, instead of using <center> tags, use this:

    <div align="center">
    
    (content)
    
    </div>
    HTML:
     
    watchintv, Nov 26, 2006 IP
  4. Luke

    Luke Peon

    Messages:
    111
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Can he not set the body to centre too?

    like so...

    body {
    margin: 0 auto;
    align: center;
    }
     
    Luke, Nov 27, 2006 IP
  5. kpwnd

    kpwnd Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can use absolute tags also.
     
    kpwnd, Nov 27, 2006 IP
  6. vinxxv

    vinxxv Well-Known Member

    Messages:
    506
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    118
    #6
    or if you're using tables, you can use this code:

    
    <table [B]align="center"[/B] width="width in pixels or %"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>content here</td>
      </tr>
    </table>
    
    
    Code (markup):
    by default, the table is aligned to left. so align="center" should do the trick :)
     
    vinxxv, Nov 29, 2006 IP