SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Page Centering

  1. #1
    SitePoint Member
    Join Date
    Nov 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Page Centering

    Hello,

    I have been using a 800x600 resolution monitor. Recently I startred to use a 1024x768 monitor. I have noticed that certain sites, which are designed to fit perfectly in the 800x600 monitor screen, that appear nicely centered when viewed on the larger monitor. For example, C-Net's web site
    http://www.cnet.com

    Whereas other sites, mine for example,
    http://www.no-occident.com/
    remain positioned to the left on the larger screen with a corresponding blank space to the right side.

    I have reviewed a number of source codes and it appeared that a simple <div align="center"></div> for the entire page would work. So far, no go.

    What am I missing?

    Thank you for your help.

    Bill

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just for the record, I never use <div></div>, so I can't give you any clue why it wouldn't work.

    What always do is create a large table with one cell. This table needs to span the entire page, so width and height need to be set to 100% both. The give the cell the attributes align="center" and valign="bottom".

    The template below should do the trick:

    Code:
    <html>
    
    <head>
    <title></title>
    </head>
    
    <body>
    
    <table width="100%" height="100%">
    <tr>
    <td align="center" height="center">
    
    Content goes here
    
    </td>
    </tr>
    </table>
    
    </body>
    
    </html>

  3. #3
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was not able to find the <div align="center"> part that should center the site.

    I suggest you place a <div align="center"> at the top of your content and a </div> to close it at the bottom. It should work, but I second Mark's suggestion, tables always work for me

    Good luck.
    Jeroen Mulder

    w: www.jeroenmulder.com

  4. #4
    SitePoint Member
    Join Date
    Nov 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help.


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
  •