Treehouse: Grow your CSS skills. Land your dream job.

can’t decipher validation errors

  • # March 25, 2009 at 6:52 pm

    I’m a relative newcomer, trying to redesign my Art League’s website.

    I’m early in the redesign, and validate often. Recently got validation errors and can’t spot what is wrong or decipher what the W3C validator is trying to tell me. Can anyone explain what these error messages are saying?

    Here are the validation errors:

    (1) Line 7, Column 77: end tag for "link" omitted, but OMITTAG NO was specified.

    _menu.css" media="all" rel="stylesheet">

    Here is my entire line 7:


    You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">"

    (2) Line 9, Column 7: XML Parsing Error: Opening and ending tag mismatch: link line 7 and head.


    Here is the entire line 9:


    (3) Line 110, Column 7: XML Parsing Error: Opening and ending tag mismatch: head line 3 and html.


    Here is the entire line 110:


    (4) Line 110, Column 7: XML Parsing Error: Premature end of data in tag html line 2.


    see above for line 110

    The strange thing is that the page validated, then later generated these errors even though I hadn’t changed any code.

    Oh, I’m using XHTML 1.0 Strict; the DOCTYPE and other code above and in the <head> follows:

    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">


    # March 25, 2009 at 7:13 pm

    Hi Dave, welcome to the forums.

    Your error is an easy one, and something that is often overlooked by people that are new to the Strict Doctype.

    Simply close out your link element like so:

    <link href="./styles/import_2liq_text_menu.css" media="all" rel="stylesheet" />

    Note the slash at the end before the closing bracket. This is required in the strict doctype. Things like <img />, <br />, <hr />, to name a few, require that "closing" slash.

    This may also clear up all of the other errors on the page!

    # March 25, 2009 at 7:35 pm

    the Doc is of course absolutly right, you have to close all tags in Strict… its da law. :)

    # March 25, 2009 at 10:16 pm

    Thanks Doc (and Rob), Yes, it did eiminate the other errors. What a relief! It was driving me nuts, and I didn’t find the "explanations" from the W3C validator very illuminating.

    BTW, I’m glad I stumbled across this site. Not just for the speedy and effective help with problems, but also for all the other goodies here. Some great articles, videos, and demos. I’ve bookmarked it and will return frequently.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.