xhtml question.

Discussion in 'HTML' started by Bern, Oct 2, 2004.

  1. Bern

    Bern Guest

    hi all,
    suppose i have the following XHTML doc.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
    <title>Welcome</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    </head>

    <body>
    <table align="center" width="100%" height="100%">
    <tr>
    <td valign="middle" align="center">
    hello
    </td>
    </tr>
    </table>
    </body>
    </html>

    If the "DOCTYPE" tag is *not* present, the word "hello" will be in the
    middle of the page
    (because of the "height" attribute in the "table" element)

    But in XHTML, the "table" element does not allow "height" attribute, what
    should i do in order to display the
    word "hello" in the middle of the page? I need a method that is compatible
    with transitional XHTML and
    also compatible with previous HTML versions.
     
    Bern, Oct 2, 2004
    #1
    1. Advertising

  2. Bern

    Toby Inkster Guest

    Bern wrote:

    > But in XHTML, the "table" element does not allow "height" attribute, what
    > should i do in order to display the
    > word "hello" in the middle of the page?


    html,body,table { height:100%; }

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Oct 3, 2004
    #2
    1. Advertising

  3. Bern

    Sam Hughes Guest

    " Bern" <> wrote in news:415ec9c6$:

    > But in XHTML, the "table" element does not allow "height" attribute,


    Nor does HTML.
     
    Sam Hughes, Oct 3, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    902
  2. chronos3d
    Replies:
    9
    Views:
    786
    Andy Dingley
    Dec 5, 2006
  3. Usha2009
    Replies:
    0
    Views:
    1,140
    Usha2009
    Dec 20, 2009
  4. xhtml champs
    Replies:
    0
    Views:
    537
    xhtml champs
    Aug 1, 2011
  5. xhtml champs
    Replies:
    0
    Views:
    1,046
    xhtml champs
    Aug 2, 2011
Loading...

Share This Page