html5一致性检查器替换了我的doctype
|
当我验证我的网页时,有时一致性检查器将验证以下随机代码而不是我的网页。
<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd\">
<!-- <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"
\"http://www.w3.org/TR/html4/strict.dtd\"> -->
<HTML>
<HEAD>
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0.1\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">
<TITLE></TITLE>
</HEAD>
<BODY><P></BODY>
</HTML>
当这样做时,我可以选择\“ show source \”选项并重新验证页面,直到出现我的源代码为止,这恰好符合html5。
为什么有时会得到这个随机代码?我通常不会在乎,但是我的一位教授一直试图因为不符合要求而停课。可悲的是,他对如何解决这个问题没有任何建议。请让我知道我是否可以在代码中进行某些更改,以避免一致性检查程序中的随机替换。
我在validator.w3.org使用检查器
以下是我的代码示例:
<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<link href=\"/css/default.css\" type=\"text/css\" rel=\"stylesheet\" media=\"screen\">
<title>Database Plan</title>
<?php include $_SERVER[\"DOCUMENT_ROOT\"].\"/modules/googleanalytics.inc\"; ?>
<!--[if lt IE 9]>
<script src=\"http://html5shiv.googlecode.com/svn/trunk/html5.js\"></script>
<![endif]-->
</head>
<body>
<div id=\"wrapper\">
<header id=\"header\">
<div id=\"redback\">
<?php include $_SERVER[\"DOCUMENT_ROOT\"].\"/modules/header.inc\"; ?>
</div>
</header>
<nav id=\"navtop\">
<div>
<?php include $_SERVER[\"DOCUMENT_ROOT\"].\"/modules/topnav.inc\"; ?>
</div>
</nav>
<div id=\"centerbox\">
<div id=\"article\">
<article id=\"innerarticle\">
<div>
<p>Article Content</p>
</div>
</article>
</div>
</div>
<footer id=\"footer\">
<div id=\"grayback\">
<?php include $_SERVER[\"DOCUMENT_ROOT\"].\"/modules/footer.inc\"; ?>
</div>
</footer>
</div>
</body>
</html>
没有找到相关结果
已邀请:
2 个回复
陈獭
很缴