Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Candi Finch
Candi Finch
915 Points

Site seems to run just fine but got LOTS of errors from http://validator.w3.org/check

I have followed along with the sessions and my website seems to be working fine. In fact I love it! But the step we are on now asks us to post our code on http://validator.w3.org/check and check for errors. Mine has 28 errors and none of them make sense because I did it the way it was done in our lesson. I fixed two small ones. They just wanted /> instead of just > for a self closing item. Here are SOME of my error messages. Does this make sense to anyone? PS. My code that was submitted is at the bottom. I separated it with a line.

Validation Output: 26 Errors

Error Line 19, Column 8: element "header" undefined

<header>


You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
    incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
    by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
    by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
Error Line 22, Column 6: document type does not allow element "h1" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

  <h1>



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Error Line 30, Column 7: element "nav" undefined

  <nav>


You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
    incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
    by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
    by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
Error Line 43, Column 11: element "section" undefined

  <section>



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Error Line 54, Column 40: an attribute value literal can occur in an attribute specification list only after a VI delimiter

            <img src="img/bear.jpg" alt""> 


Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute="value".
Error Line 54, Column 41: end tag for "img" omitted, but OMITTAG NO was specified

            <img src="img/bear.jpg" alt""> 




Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute="value".
Error Line 82, Column 42: end tag for "img" omitted, but OMITTAG NO was specified

            <img src="img/relic.jpg" alt""> 



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Error Line 91, Column 9: name start character invalid: only S separators and TAGC allowed here

  </div id="wrapper">

Error Line 92, Column 10: element "footer" undefined

  <footer>



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Info Line 93, Column 54: start tag was here

I just noticed that my Dreamweaver started my pages for me and their !DOCTYPE code has a lot more to it than ours did on the tutorials.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="css/normalize.css"/> <link href='http://fonts.googleapis.com/css?family=Indie+Flower|Libre+Baskerville:400,400italic,700' rel='stylesheet' type='text/css'/> <link rel="stylesheet" href="css/main.css"/>

<title> Chaetaum </title> <link rel="stylesheet" href="css/responsive.css" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />

</head>

<body>

<header> <a href="index.html" id="logo">

<h1> Chaetaum Website

</h1> <h2> Candi Finch </h2> </a> <nav>

<ul> <li><a href="index.html" class="selected"> Portfolio </a></li> <li><a href="about.html"> About </a></li> <li><a href="contact.html"> Contact Me </a></li> </ul> </nav>

</header>

<div id="wrapper"> <section> <ul id="gallery"> <li> <a href="img/billjack.JPG"> <img src="img/billjack.jpg" alt""> <p>Bill and Jack Enjoying the day!</p> </a> </li>

     <li> 
        <a href="img/bear.JPG"> 
        <img src="img/bear.jpg" alt""> 
        <p>Bear Enjoying the day!</p>
       </a>
    </li>

     <li> 
        <a href="img/ike.JPG"> 
        <img src="img/ike.jpg" alt""> 
        <p>Ike Enjoying the day!</p>
       </a>
    </li>

     <li> 
        <a href="img/hammer1.JPG"> 
        <img src="img/hammer1.jpg" alt""> 
        <p>Hammer Enjoying the day!</p>
       </a>
    </li>

     <li> 
        <a href="img/ruger1.JPG"> 
        <img src="img/ruger1.jpg" alt""> 
        <p>Ruger Enjoying the day!</p>
       </a>
    </li>

     <li> 
        <a href="img/relic.JPG"> 
        <img src="img/relic.jpg" alt""> 
        <p>Relic Enjoying the day!</p>
       </a>
    </li>


  </ul>

</section>

</div id="wrapper"> <footer> <a href="https://www.facebook.com/candi.finch"><img src="img/fbimg.jpg" alt="Facebook Logo" class="social-icon"> </a> <p> © 2015 Candi Finch. </p> </footer>

</body> </html>

3 Answers

Candi Finch
Candi Finch
915 Points

I figured it out. I had an error in the very beginning that was throwing everything else off. Thank you for the help.

Glad you figured it out. :)

It seems to answer your question for you. From what I see, each error is followed by a block of text explaining it and how to resolve it. Am I missing something?

Candi Finch
Candi Finch
915 Points

I have the same code as the instructor did and he came up with no errors when he ran he code. My question is, why does my code have errors when it is exactly the same as the instructors?