
Originally Posted by
J Windebank
I don't agree entirely. I could be wrong, but I thought HTML 4.1 Strict does not require closing tags correctly and allows some deprecated tags and elements? If so, then to me, it makes more sense to stick with XHTML 1.0 Strict.
Regards,
Jordan
HTML 4.1 Strict requires nesting tags correctly, but there are tags (like <p> and <li>) that can be optionally closed. Try validating the following code and the validator will throw errors :
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Sample</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
</head>
<body>
<div><span></div></span>
</body>
</html>
You can always add closing tags, when they're optional, for the sake of readability though (like many designers who use HTML4.1 strict do).
Also, HTML4.1 does not allow deprecated elements. w3.org says :
The HTML 4.01 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents.
Sitepoint's DHTML utopia uses HTML 4.1 Strict for it's scripts, even though Javascript\DOM requires a document with perfectly nested tags in order to work properly.
You can still stick to xHTML strict, but it's always going to be HTML 4.1 strict with some extra slashes as long as you serve it as an HTML document, not an XML application.
Bookmarks