SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    weird situation i need clearing up

    hi guys im in a weird situation and dont have a clue why one works and the other dont.

    Firstly here is the first with declaration
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <table width="100%" height="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">this should be in CENTRE of screen</td>
      </tr>
    </table>
    </body>
    </html>
    RIGHT NOTICING THAT IT DONT CENTER THE TEXT IN THE MIDDLE OF THE SCREEN.

    here is the second link now with the declaration taken out without declaration
    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <table width="100%" height="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">this should be in CENTRE of screen</td>
      </tr>
    </table>
    </body>
    </html>
    this works and centers the text, why is this happening? whats with the declartion? please somebody clear this up for me.

    Thanks ever so much

  2. #2
    SitePoint Evangelist
    Join Date
    Jan 2002
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is because the height attribute is not valid HTML 4.01, and when you use the declaration browsers don't interpret the invalid attribute.
    Wavelan

  3. #3
    SitePoint Member ahmed momtaz's Avatar
    Join Date
    Dec 2003
    Location
    egypt
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [QUOTE=abcdef]hi guys im in a weird situation and dont have a clue why one works and the other dont.

    Firstly here is the first with declaration
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <table width="100%" height="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">this should be in CENTRE of screen</td>
      </tr>
    </table>
    </body>
    </html>

    check this[CENTER]


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset="windows-1256">
    </head>

    <body>
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="center" valign="middle">this should be in CENTRE of screen</td>
    </tr>
    </table>
    </body>
    </html>

    </body>
    </html>

  4. #4
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so just changing the char set sorted the height attribute ? this right ?

  5. #5
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well regarding all this then? the idea is i want something centering in the browser window! which will work across browsers.
    What is the best way to center something? is it the code above posted by "ahmed" ?

  6. #6
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac


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
  •