Code Snippet

Home » Code Snippets » HTML » XHTML 1.0 STRICT Page Structure

XHTML 1.0 STRICT Page Structure

<!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" xml:lang="en" lang="en">

<head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
       <title>Page Title</title>
       <link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/>
</head>

<body>

</body>

</html>

Subscribe to The Thread

  1. abajan

    Is it necessary to split the doctype into 2 lines or is that just for readability sake?

    Which character set is more recommended – utf-8 or ISO-8859-1?

    Shouldn’t there be a space before the last slashes (/) in lines 7 and 9 to accommodate older browsers?

    Thanks.

    • I don’t split doctype into 2 lines, it works.

    • Vikas Burman

      Excellent ,good,

  2. elandy2009

    It isn’t necessary to split the doctype into 2 lines, it’s for readability sake.

  3. H5N1

    1 – If the Accept header explicitly contains application/xhtml+xml (with either no “q” parameter or a positive “q” value) deliver the document using that media type. (http://www.w3.org/TR/xhtml-media-types/#media-types)
    so

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    should be

    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

    2 – For back-compatibility issues is reccommended to left a space before the last slash closing elements.

    3 – The XML Prolog is optional, but according to XML specifications should be there. (XHTML is HTML + XML).

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~