• Resolved Jimmy

    (@jayem82)


    When I enter my homepage adress in the W3C Markup Validation Service, http://www.jayem.se I get 31 erros, almost all of them are:

    document type does not allow element “li” here; missing one of “ul”, “ol”, “menu”, “dir” start-tag

    What is wrong, and how do I fix this so my page is validated?

Viewing 7 replies - 1 through 7 (of 7 total)
  • all <li> tags must come inside one of the tags listed (usually <ul>, for “unordered list”, a list of items with bullet points, or just a list, depending on the styling.)

    So, in your HTML (most likely the “sidebar.php” file, or something of that nature), you need to put <ul> </ul> around your <li> tags.

    Thread Starter Jimmy

    (@jayem82)

    I see. But will this not make my lists move more to the right? Not looking good…?

    The list is styled by your CSS. It will only move if your CSS tells it to.

    Thread Starter Jimmy

    (@jayem82)

    How do I style them not to?
    My css looks like this now:

    li {
    list-style-type: none;
    list-style-position: outside;
    margin: 0;
    left:0px;
    }

    ul {
    list-style-type: none;
    list-style-position: inside;
    margin: 0;
    left:0px;
    }

    What to change if I don’t want the lists to be pushed to the right?

    Thread Starter Jimmy

    (@jayem82)

    Just figured out how to make it all look good, so don’t mind the last post.

    The problem now is that when I validate my page, I still have 3 errors, all:

    end tag for element “li” which is not open

    It seems as wordpress adds a tag after wp_list_pages, also both and after get_links_list.

    Can I make wordpress not add these?

    WP doesn’t add any invalid code. If there is something wrong that comes from your theme and/or your own editing.

    Thread Starter Jimmy

    (@jayem82)

    Just fixed everything on the page and it is now validated.
    I changed the get_links_list to wp_get_links and it all worked out.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problems validating’ is closed to new replies.