have proofread this code a dozen times. Can't find error. Have substituted transitional for strict. Still shows in page.

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

2 answers

Ktash 1851
0
points

It will show up in your page if you have any code before it. The doctype should be the very first thing in the page, if it is not, it will not render it correctly. For example, here is a correct doctype declaration:

<!doctype html>
<html>
    <head>
         <title>...</title>
    </head>
    <body>
        ....
    </body>
</html>

Where as this is an in correct doctype declaration, and it will appear on the page in some browsers.

<html>
<!doctype html>
...

Also, make sure you have the ! (bang) before the keyword doctype. If not, it will not consider it a doctype declaration. If you are still having issues, please post the code you are using including the following: all code/space up to and including the doctype (should be just whitespace), the next 5 lines of code.

Update

The following is a valid doctype declaration and page for XHTML Strict. Make sure your page matches it (specifically the first threelines) exactly:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>...</title>
    </head>

    <body>
    </body>
</html>
Answered about 8 years ago by Ktash
0
points

The <!DOCTYPE is the first line of code. Itis followed by the code above and the error seems to be in thecode above

Answered about 8 years ago by Larry Tilis
  • I've updated my answer above. Make sure your code matches it exactly. Ktash about 8 years ago