WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Validating my blog (6 posts)

  1. adam513
    Member
    Posted 8 years ago #

    Hi, I have been blogging for quite a while now, but I never validated my site properly. I am giving another try now.

    http://validator.w3.org/check?uri=http%3A%2F%2Fnostalgic-garden.org%2F&charset=%28detect+automatically%29&doctype=Inline

    It seems most of the errors are related, and identical.
    Therefore (I am guessing) they should be easy to resolve.

    Regards,
    Adam

  2. moshu
    Member
    Posted 8 years ago #

    If you check the "Show Source" box and click Revalidate - every line with errors will become a clickable link and you could see exactly where your errors are.

  3. adam513
    Member
    Posted 8 years ago #

    Uh... thanks for your quick reply, but the problem is that I don't even know what they mean xD
    I gave a few attempts but when I tried to revalidate it, I only got more errors!

  4. Doodlebee
    Member
    Posted 8 years ago #

    "1. Error Line 109 column 3: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag."

    This means that you have a list on your page that simply begins with the <li> tag. That's improper formulation of lists. Your lists should look like so:

    <ul> (or <ol> for a numbered, ordered list)
    <li></li>
    </ul>
    (or </ol>)

    They are also telling you that it's possible that your have your li tags formed properly, but you've forgotten to close one someplace. *Or* that you've placed a block-level element (like a <p> tag) within an inline element (like a <span> tag) which is a no-no.

    Google for the difference between "inline" and "block level" so you know what's up there.

    "2. Error Line 121 column 33: document type does not allow element "table" here; assuming missing "li" start-tag.

      <table id="wp-calendar">"

      Why you are putting a table *within* an unordered list is absolutely confounding. There is no need whatsoever to do this. Either put the information in a table (if it's tabular data) or put it in a <ul> list. Don't do both. There's no reason for it at all.

      "3. Error Line 160 column 13: end tag for "li" omitted, but OMITTAG NO was specified.

      </table>

    "

    This goes with the above - you used the <ul> tag with no <li>. Don't do that. If you fix this error, a *lot* of these errors will simply go away. If you use <ul> then you *must* have <li> as well.

    I could continue on - but it pretty much looks the same. You have <ul> tags with no <li> tags - which is a no-no. And in some cases you have <li> tags with no prior opening <ul> tags.

    You can go through and fix all of these errors - but I'm guessing that it'll cause a big headache if you don't know CSS, cause it's gonna screw up your layout. When you remove those incorrect tags, then your "boxes" will move around in a way that you don't want, and you need to use proper CSS to position them correctly (which, when it comes to CSS, I'm guessing you're pretty new at or you wouldn't be asking this question ;) )

    An alternative solution would be to just change your doctype. It may not fix everything, but it'll render it better if you swap out your doctype from XHTML 1.0 Transitional (which you are currently using) to HTML 4.0 Transitional. You just need to swap it out in the header.php file.

    Change these lines:

    " <!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">"

    to this:

    "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">"

    The latter will recognize deprecated tags and "messed up" code (to an extent) as well as allow for the newer tags.

    Hope that helps you.

  5. moshu
    Member
    Posted 8 years ago #

    An alternative solution would be to just change your doctype.

    I am not sure that's a wise idea :)
    WP template tags and the engine itself generate code to be valid for XHTML Transitional 1.0 - so you may end up with even more errors.

  6. adam513
    Member
    Posted 8 years ago #

    That greatly helped! Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic