HTML 1 - Validator Error Messages

Now that you've done some reading about block elements and inline elements, you should be able to make a lot more sense of the error messages you get from the W3C Validator. Below is a list of typical messages, followed by a probable remedy. This page is a work in progress, so if you get one you can't figure out, let me know and, if it's a common one, I'll add it to the list.

Remember that if the validator says you have 45 errors, there are probably only one or two that mess up everything below it. Always fix the first error first, test the code again, and you'll likely have far fewer (if any) problems.

  1. Line 19, Column 4: end tag for "hr" omitted, but OMITTAG NO was specified.
    <hr>

    Translation: This is an empty tag that must be closed with a space and forward slash - <hr />. You get the same kind of message with incorrect break tags, image tags, and meta tags.


  2. Line 23, Column 49: character data is not allowed here.
    … makes my life <em>wonderful</em>!</h2> Now I want to give that ...

    Translation: You have plain text occurring outside a block element.


  3. Line 23, Column 107: document type does not allow element "a" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
    …m <a href="http://www.wikipedia.org/">wikipedia.org</a>)

    Translation: You have a link occurring outside a block element.


  4. Line 54, Column 30: character "&" is the first character of a delimiter but occurred as data.
    <h1>Roses & Violets</h1>

    Translation: You used an ampersand (&) in your text. The ampersand is used to begin all character entities in HTML (see pp. 114-5 in your book) and is considered VERY special. So, if you want to use an ampersand, write it &amp;.

    You could also get this kind of error if there is an ampersand in a very complex URL that you are including. You can go into the URL and change the ampersand to
    &amp;, and the URL will still work fine!


  5. Line 15, Column 7: end tag for element "P" which is not open.
    </P>

    Translation: You used a capital letter by accident. In Strict XHTML 1.0, a p is not the same as a P.


  6. Line 17, Column 7: document type does not allow element "h2" here; missing one of "object", "ins", "del", "map", "button" start-tag.
    <h2>My Life</h2>

    Translation: A previous block element was not closed properly.


  7. Line 10, Column 13: an attribute specification must start with a name or name token.
    <p> <id="top"> </p>

    Translation: The attribute cannot occur by itself; it must be located inside a tag - <p id="top"> </p>


  8. Line 56, Column 13: character data is not allowed here.
    <blockquote>This is some text.</blockquote>

    Translation: You must include a block element directly within a blockquote element. Think of blockquote as a mini-body tag.


  9. Sometimes the validator won't even try to validate your page. I can't find an example right now with the exact wording, but it says something to the effect that there is a character in the page it doesn't recognize.

    Translation: You've included a non-ASCII character that was probably a part of some fancy font in the original text. Look for atypical quotes, an em-dash, something like that, and erase it. Type it in again in using the font that your text editor uses by default.


Return to Top

Valid XHTML 1.0 Strict