我一直在网站上工作,我们已经被要求加载php,并使用页眉/页脚。我的工作是没有错误的,除了一个"头部的结束tage没有完成错误"我已经将头部标记移动到整个地方,并且无法弄清楚为什么它仍然会抛出错误。当我验证
时,如何解决这个愚蠢的错误<!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>
答案 0 :(得分:0)
您的问题是该页面没有<title>
元素。这是必需的。
最好的办法是将代码放入http://validator.w3.org/,它通常会为您提供有关错误的有用信息。
在这种情况下,它会显示......
blah blah blah另一种可能性是你使用了一个需要孩子的元素 您未包含的元素。因此,父元素是“不是 完成“,但不完整。例如,在HTML中,<head>
元素必须 包含<title>
子元素,列表需要适当的列表项blah blah blah