html – WCAG 2.0 validation errors: Element span= not allowed as child of element a in this context. (Suppressing further errors from this subtree.)-ThrowExceptions

Exception or error:

Hello to the community again! I’m trying to validate a WordPress site and I got the following 4 errors that most probably are connected:

Line 182, Column 26: Quote ” in attribute name. Probable cause: Matching quote missing somewhere earlier.

Line 182, Column 27: Element span=”la not allowed as child of element a in this context. (Suppressing further errors from this subtree.)

Content model for element a:
Transparent, but there must be no interactive content or a element descendants.

Line 182, Column 34: Stray end tag span.

Line 183, Column 4: End tag a violates nesting rules.

The code in question is the following:

    <footer id="colophon" class="site-footer" role="contentinfo">
        <div class="footer-widget-area">
        <div class="wrapper">
            <div class="flex-grid">
                            <div class="col">
                    <div id="custom_html-5" class="widget_text widget widget_custom_html"><div class="textwidget custom-html-widget"><script data-account="iFDG9kXlfW" src=""></script></div></div>                </div>
    <div class="site-info">
    <div class="wrapper">
                    copyright all rights reserved            <span class="sep"> | </span>
                Theme: Minimal Blog by <a href="" rel="designer">WPinterface</a>.    </div>
</div><!-- .site-info -->

<a id="scroll-top">
    <span="la la-arrow-up"></span>

You can also check the site, it’s only in Greek yet though but here’s the link:

Thank you all in advance for your time, any help will be really appreciated!

How to solve:

two things

  1. <a> must have a href to be valid (not part of your error, just a best practice). Leave it as an anchor (<a>) and set the href="current page URL" in the generated HTML so that if JavaScript fails it will simply reload the page, giving the same effect.

  2. <span="la la-arrow-up"></span> – did you miss class="" you can’t have a span equal to something. Instead it should be <span class="la la-arrow-up"></span>.

Change your scroll to top arrow to:-

    <button id="scroll-top">
        <span class="la la-arrow-up"></span>

Leave a Reply

Your email address will not be published. Required fields are marked *