Code Snippet
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>
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.
Excellent ,good,
It isn’t necessary to split the doctype into 2 lines, it’s for readability sake.
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).
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.