Welcome to the Blackout Audio Techno Forums :: Underground Network.
Results 1 to 3 of 3
  1. #1
    BOA Newbie
    Join Date
    Jul 2005
    Posts
    6

    Default Get webppage to centre itself

    I was wondering if anyone could help me to sort this out. Ive made a webpage so it fits on a 800x600 resolution screen jst to accomodate everyone. As i use 1280x1024 it appears only in the top corner quite small.
    Now i am trying to get the page so it will always centre itself no matter what resolution is used and with no side scrolling needed etc. Ive seen websites that do it yet am not sure what part of the code is doing it. If any of you guys know how to do this that would be great.

    Cheers

  2. #2
    Parsnip
    Join Date
    Apr 2004
    Location
    Bangalore, India
    Posts
    15,336

    Default

    Here is the hacky way to do it:

    Code:
    <html>
    
    <head>
      <title>My Webpage</title>
      <!-- Other header stuff here -->
    </head>
    
    <body>
    
      <table width="100%" height="100%">
        <tr>
          <td align="center" valign="middle">
    
            <table width="800" height="600">
              <tr>
                <td>
    
                  <!-- Put your page content here -->
    
                </td>
              </tr>
            </table>
    
          </td>
        </tr>
      </table>
    
    </body>
    
    </html>
    So, essentially what you're doing is creating a single-celled table inside a bigger single-celled table which fills the screen and the content of which is centred both horizontally and vertically.

    This is a really horrible way of doing this and you can do it much neater with CSS, but this runs straight out of the box.

  3. #3
    BOA Newbie
    Join Date
    Jul 2005
    Posts
    6

    Default

    hey thanks for that , works like a charm. I thought of another question now hoped you might know the answer; i made my webpage design in photoshop , sliced it and save for web - however when i do a W3c web validation thing i get over 70 errors even though it's straight out of photoshop. It mainly seems to be the end markers like > that give the errors and also a randon letter 'c' in a webaddress for a stat counter. I thought it might possibly be to do with the DOCTYPE header stuff but am not sure. ANyone know why photoshop does this or how to fix it ? Actually does the validation thing even matter i just noticed on your site Techmouse you get 2 errors even though there's one thing on it. Here's the validator http://validator.w3.org/



    cheers

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Back to top