tags:

views:

70

answers:

4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

<?xml version="1.0" encoding="UTF-8"?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>My Title</title>

<link rel="stylesheet" type="text/css" href="myStyle.css"/>

</head>
<body>

<div>

<h1>Heading One</h1>
<p class="para1">Paragraph One</p>

<h3>Heading Two</h3>
<p>Paragraph Two</p>

<h3>Heading Three</h3>
<p>Paragraph Three</p>

<br />
<a href="Lab1Page2.html">Link One</a>
<br />
<a href="Lab1Page3.html">Link Two</a>

</div>

</body>
</html>
+9  A: 
<p>Paragraph Three<p>

That is the problem.

Edit: the other <p> should obviously be </p>

Edit 2: Noticed a larger problem: The XML definition or whatever-it's-called should always be on the first line. If I recall correctly.

Edit 3: Yup, I checked. W3 validator tells this:

XML declaration allowed only at the start of the document

esalaka
Regarding Edit 2: If I remember correctly, IE will fail to set Standards Mode when anything is between the beginning of the document and the doctype. Best idea is to leave the XML declaration out, I read somewhere.
MvanGeest
But the XML declaration is necessary.
esalaka
(I fixed the <p>)It says:1 error, 3 warningsNo Character Encoding Found! Falling back to UTF-8.Unable to Determine Parse Mode!No Character encoding declared at document levelLine 1, Column 1: end of document in prolog.
Justice Conder
Justice, read edits 2 and 3.
esalaka
xml declaration could be omitted at all: http://www.w3.org/TR/xhtml1/#C_1
Imre L
+1  A: 

You can run it through the W3C checker here (click on the "direct input" tab and copy/paste) and it will give you very specific feedback as to what doesn't validate

Daniel DiPaolo
I fixed all the problems that people mentioned. The validator says its good if i paste my work in it but if i choose the upload option it says it still has errors. Why would it do that?
Justice Conder
+2  A: 

Run it through the W3C validator, and it will point you right at the problems: http://validator.w3.org/

Specifically:

This:

<?xml version="1.0" encoding="UTF-8"?>

Must go at the very top of the document, not below the DOCTYPE.

And you've forgotten a '/' on the closing p tag here:

<p>Paragraph Three<p>

Once those problems are corrected, it validates just fine.

Nicholas Knight
This man is correct. He said what I did but in a less confusing way and fixed both problems at the same time.
esalaka
A: 

Try this:

 <?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>My Title</title>

<link rel="stylesheet" type="text/css" href="myStyle.css"/>

</head> <body>

<div>

<h1>Heading One</h1> <p class="para1">Paragraph One</p>

<h3>Heading Two</h3> <p>Paragraph Two</p>

<h3>Heading Three</h3> <p>Paragraph Three</p>

<br /> <a href="Lab1Page2.html">Link One</a> <br /> <a href="Lab1Page3.html">Link Two</a>

</div>

</body> </html>

The <?xml version="1.0" encoding="UTF-8"?> must be the first line in the XML document. See the XML Specifications: http://www.w3.org/TR/2006/REC-xml11-20060816/

Drunken Programmer