I am using Dreamweaver CS6. I created a template from a page which validates W3C perfectly.
I apply that template to a blank new page.
I validate. It fails with numerous errors in the header.
My simple test file:
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Val Test</title>
<link rel="stylesheet" href="mm_spa_index.css" type="text/css" />
</head>
<body>
Validation Test
</body>
</html>
The validation errors I get are: (all seem related to not finding the doctype statement, however this cannot be fixed in the page with the template applied)
2 document type does not allow element "head" here; assuming missing "html" start-tag [XHTML 1.0 Transitional]
2 Missing xmlns attribute for element html. The value should be: http://www.w3.org/1999/xhtml [XHTML 1.0 Transitional]
3 there is no attribute "charset" [XHTML 1.0 Transitional]
3 required attribute "content" not specified [XHTML 1.0 Transitional]
3 end tag for "meta" omitted, but OMITTAG NO was specified [XHTML 1.0 Transitional]
DOCTYPE Override in effect! [XHTML 1.0 Transitional]
Should be simple, but I must be missing something. Any suggestions appreciated.
You're trying to validate an HTML5 doc type with XHTML validation settings.
A basic HTML5 Template should resemble this. No coding errors reported:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<style>
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #000;
}
</style>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<body>
<header>Header</header>
<section>
<!-- TemplateBeginEditable name="Content" -->
<aside>Aside1</aside>
<aside>Aside2</aside>
<aside>Aside3</aside>
<!-- TemplateEndEditable -->
</section>
<footer>Footer</footer>
</body>
</html>
Nancy O.
I see what's wrong. I had a trailing </html> without a leading <html>
Putting in the leading <html> fixes it.
I tried without any <html> </html> and DW does not like that. It puts the template comment ahead of the <! doctype html> which is what causes the problem.
Interestingly, the validator does not pick up on the trailing </html> without the leading <html>
North America
Europe, Middle East and Africa
Asia Pacific