未完成的头部的结束标记?
End Tag for head which is not finished?
我一直在做一个网站,我们被要求合并 php,并使用 headers/footers。我的工作没有错误,除了 "End tage for head which is not finished error" 我已经将 head 的结束标记移到了各处,但无法弄清楚为什么它仍然会抛出错误。验证时如何解决这个愚蠢的错误
<!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" />
<link rel="stylesheet" type="text/css" href="../seltzerr/css/webd2201.css" />
<!--
Author: Ryan Seltzer
Filename: header.php Date: 2015-02-19 Description: This file is the header for all of my web pages, it includes the styling of the page, colors, banner and all of the links to my other web pages
and will be implemented on future assignments as well.-->
</head>
<body>
<div id="container">
<div id="header">
<a href="http://www.durhamcollege.ca">
<img src="./images/dclogo.jpg" alt="Durham College Logo"/>
</a>
<h1>
Ryan Seltzer's Website
</h1>
</div>
<div id="sites">
<ul>
<li><a href="http://opentech.durhamcollege.ca/~pufferd/intn2201/">INTN2201</a></li>
<li><a href="http://www.w3schools.com">W3Schools</a></li>
<li><a href="http://validator.w3.org">XHTML Validator</a></li>
<li><a href="http://jigsaw.w3.org/css-validator/">CSS Validator</a></li>
<li><a href="http://php.net/manual/en/index.php">PHP Manual</a></li>
<li><a href="http://www.durhamcollege.ca">Durham College</a></li>
</ul>
</div>
<div id="content-container">
<div id="navigation">
<h3>
Navigation Bar
</h3>
<ul>
<li><a href="../seltzerr/index.php">Home Page</a></li>
<li><a href="../seltzerr/lab1.php">Lab 1: Basic XHTML pages</a></li>
<li><a href="../seltzerr/lab2.php">Lab 2: Working with HTML Tables</a></li>
<li><a href="../seltzerr/lab3.php">Lab 3: Formatting and Layout with Styles</a></li>
<li><a href="../seltzerr/termtest1.php">Term Test 1: Practical</a></li>
<li><a href="../seltzerr/lab4.php">Lab 4: PHP Chapter Files from textbook</a>
<ul>
<li><a href="../seltzerr/lab4phptags.php">Lab 4: PHP Start and End Tags</a></li>
<li><a href="../seltzerr/lab4firstscript.php">Lab 4: PHP Code Cohabitation</a></li>
<li><a href="../seltzerr/lab4errorscript.php">Lab 4: PHP Escaping Your Code</a></li>
<li><a href="../seltzerr/lab4errorscript2.php">Lab 4: PHP Escaping Your Code Part 2</a></li>
<li><a href="../seltzerr/lab4comments.php">Lab 4: PHP Commenting Your Code </a></li>
<li><a href="../seltzerr/lab4printvarscript.php">Lab 4: PHP Variable and Value Types</a></li>
<li><a href="../seltzerr/lab4constants.php">Lab 4: PHP Using Constants </a></li>
<li><a href="../seltzerr/lab4constants2.php">Lab 4: PHP Using Constants 2</a></li>
<li><a href="../seltzerr/lab4assignscript.php">Lab 4: PHP Assignment Operators</a></li>
<li><a href="../seltzerr/lab4comparisonscript.php">Lab 4: PHP Comparison Operators</a></li>
<li><a href="../seltzerr/lab4logicalscript.php">Lab 4: PHP Logical Operators</a></li>
</ul>
</li>
</ul>
</div>
<div id="content"><!--
Author: Ryan Seltzer
Filename: header.php Date: 2015-02-19 Description: This file is the header for all of my web pages, it includes the styling of the page, colors, banner and all of the links to my other web pages
and will be implemented on future assignments as well.-->
<h2>Ryan Seltzer's Home </h2>
<p>This page was created for the class <a href ="http://opentech.durhamcollege.ca/~pufferd/intn2201">WebD2201</a>
at <a href="http://www.durhamcollege.ca">Durham College</a> as a home page for
all of the assignments given over the course of this semester. The objective of this
website is to serve as a home page for all of the coming assignments. It will have links
to each assignment done and will follow a similar shape and feel to all assignments.</p>
<!-- end of main page content -->
</div>
<div id="footer">
<!-- start of footer -->
<a href="http://validator.w3.org/check?uri=referer">
<img style="width:88px;
height:31px;"
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="width:88px;
height:31px;"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" />
</a>
© Ryan Seltzer, 2015
<!-- end of footer -->
</div>
</div>
</div>
</body>
</html>
您的问题是页面没有 <title>
元素。这是必需的。
最好的办法是将您的代码放入 http://validator.w3.org/,它通常会为您提供有关问题的有用消息。
在这种情况下,它将显示...
blah blah blah Another possibility is that you used an element which requires a child
element that you did not include. Hence the parent element is "not
finished", not complete. For instance, in HTML the <head>
element must
contain a <title>
child element, lists require appropriate list items blah blah blah
我一直在做一个网站,我们被要求合并 php,并使用 headers/footers。我的工作没有错误,除了 "End tage for head which is not finished error" 我已经将 head 的结束标记移到了各处,但无法弄清楚为什么它仍然会抛出错误。验证时如何解决这个愚蠢的错误
<!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" />
<link rel="stylesheet" type="text/css" href="../seltzerr/css/webd2201.css" />
<!--
Author: Ryan Seltzer
Filename: header.php Date: 2015-02-19 Description: This file is the header for all of my web pages, it includes the styling of the page, colors, banner and all of the links to my other web pages
and will be implemented on future assignments as well.-->
</head>
<body>
<div id="container">
<div id="header">
<a href="http://www.durhamcollege.ca">
<img src="./images/dclogo.jpg" alt="Durham College Logo"/>
</a>
<h1>
Ryan Seltzer's Website
</h1>
</div>
<div id="sites">
<ul>
<li><a href="http://opentech.durhamcollege.ca/~pufferd/intn2201/">INTN2201</a></li>
<li><a href="http://www.w3schools.com">W3Schools</a></li>
<li><a href="http://validator.w3.org">XHTML Validator</a></li>
<li><a href="http://jigsaw.w3.org/css-validator/">CSS Validator</a></li>
<li><a href="http://php.net/manual/en/index.php">PHP Manual</a></li>
<li><a href="http://www.durhamcollege.ca">Durham College</a></li>
</ul>
</div>
<div id="content-container">
<div id="navigation">
<h3>
Navigation Bar
</h3>
<ul>
<li><a href="../seltzerr/index.php">Home Page</a></li>
<li><a href="../seltzerr/lab1.php">Lab 1: Basic XHTML pages</a></li>
<li><a href="../seltzerr/lab2.php">Lab 2: Working with HTML Tables</a></li>
<li><a href="../seltzerr/lab3.php">Lab 3: Formatting and Layout with Styles</a></li>
<li><a href="../seltzerr/termtest1.php">Term Test 1: Practical</a></li>
<li><a href="../seltzerr/lab4.php">Lab 4: PHP Chapter Files from textbook</a>
<ul>
<li><a href="../seltzerr/lab4phptags.php">Lab 4: PHP Start and End Tags</a></li>
<li><a href="../seltzerr/lab4firstscript.php">Lab 4: PHP Code Cohabitation</a></li>
<li><a href="../seltzerr/lab4errorscript.php">Lab 4: PHP Escaping Your Code</a></li>
<li><a href="../seltzerr/lab4errorscript2.php">Lab 4: PHP Escaping Your Code Part 2</a></li>
<li><a href="../seltzerr/lab4comments.php">Lab 4: PHP Commenting Your Code </a></li>
<li><a href="../seltzerr/lab4printvarscript.php">Lab 4: PHP Variable and Value Types</a></li>
<li><a href="../seltzerr/lab4constants.php">Lab 4: PHP Using Constants </a></li>
<li><a href="../seltzerr/lab4constants2.php">Lab 4: PHP Using Constants 2</a></li>
<li><a href="../seltzerr/lab4assignscript.php">Lab 4: PHP Assignment Operators</a></li>
<li><a href="../seltzerr/lab4comparisonscript.php">Lab 4: PHP Comparison Operators</a></li>
<li><a href="../seltzerr/lab4logicalscript.php">Lab 4: PHP Logical Operators</a></li>
</ul>
</li>
</ul>
</div>
<div id="content"><!--
Author: Ryan Seltzer
Filename: header.php Date: 2015-02-19 Description: This file is the header for all of my web pages, it includes the styling of the page, colors, banner and all of the links to my other web pages
and will be implemented on future assignments as well.-->
<h2>Ryan Seltzer's Home </h2>
<p>This page was created for the class <a href ="http://opentech.durhamcollege.ca/~pufferd/intn2201">WebD2201</a>
at <a href="http://www.durhamcollege.ca">Durham College</a> as a home page for
all of the assignments given over the course of this semester. The objective of this
website is to serve as a home page for all of the coming assignments. It will have links
to each assignment done and will follow a similar shape and feel to all assignments.</p>
<!-- end of main page content -->
</div>
<div id="footer">
<!-- start of footer -->
<a href="http://validator.w3.org/check?uri=referer">
<img style="width:88px;
height:31px;"
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="width:88px;
height:31px;"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" />
</a>
© Ryan Seltzer, 2015
<!-- end of footer -->
</div>
</div>
</div>
</body>
</html>
您的问题是页面没有 <title>
元素。这是必需的。
最好的办法是将您的代码放入 http://validator.w3.org/,它通常会为您提供有关问题的有用消息。
在这种情况下,它将显示...
blah blah blah Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the
<head>
element must contain a<title>
child element, lists require appropriate list items blah blah blah