Question

I'm taking a basic javascript class, pretty straightforward..except my teacher gave me this feedback on my last assignment:

Note their are some html validation errors with your head area in your html - you may have deductions for html syntax errors in future assignments.

Here is the relevant code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>myTitle</title>
    <h3 class = "Heading">myHeading</h3>    
    <meta charset = "UTF-8">
    <link rel = "stylesheet" type = "text/css" href = "cssFile.css" >
</head> 

I don't quite understand, what did I do wrong?

Was it helpful?

Solution

You may try to use: http://validator.w3.org/#validate_by_input enter your code there and you'll see a lot of 11 errors and 2 warnings. Your heading goes in the body not in your head.

This alone removes six of your errors (errors are still present, you need to run your code into the above link).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>myTitle</title>   
    <meta charset = "UTF-8">
    <link rel = "stylesheet" type = "text/css" href = "cssFile.css" >
</head>
<body>
<h3 class = "Heading">myHeading</h3> 
</body> 
</html>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top