WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need help with code error found on w3c (5 posts)

  1. azsunshine
    Member
    Posted 10 months ago #

    Not being code savvy, can someone please tell me how to fix this error that was found for my site using w3c. Here is the error:

    Line 142, Column 23: document type does not allow element "span" here;
    assuming missing "li" start-tag
    <ul><span class="arri"></span><span class="arri2"></span>

    Line 143, Column 7: document type does not allow element "li"here; missing one of "ul", "ol" start-tag
    <li>

    I've located the code on my site. Here's how it reads:

    <ul><span class="arri"></span><span class="arri2"></span>
                 <li>

    Thanks, I appreciate your time and help.

  2. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

    Depends where that code is being generated. What theme are you using and/or what is the site URL?

  3. Scriptrunner (Doug Sparling)
    Member
    Posted 10 months ago #

    Take a look here for general explanations of your validation errors:

    Explanation of the error messages for the W3C Markup Validator

    Looking at your snippet, I imagine it's complaining that you're using a span tag directly after a ul tag, which is invalid. Off the top of my head, I'm pretty sure only an li tag is allowed there.

    It needs to be more like this:

    <ul>
    <li><span class="arri"></span><span class="arri2"></span></li>
    </ul>
  4. azsunshine
    Member
    Posted 10 months ago #

    Thank you so much Scriptrunner! That was the issue!

  5. Scriptrunner (Doug Sparling)
    Member
    Posted 10 months ago #

    @jaycee29 You're quite welcome. Good luck and happy coding!

Reply

You must log in to post.

About this Topic