Search code examples
htmlvalidationgoogle-search-consolegoogle-crawlers

Why Google crawler and Markup Validator sees this as an error?


For days now I try to figure out why I get this error from Markup Validation (link is actual validation of the site. Do not mind other errors in it, the top <p> tag is the problem for now, other errors comes from database content I yet to fix) and Google's webmaster tools "Fetch as Google" also hates it. I am sure it is something very trivial.

Validator says:

"No p element in scope but a p end tag seen." As you can see I have p element too.

Google crawler says: enter image description here

I assume the bright red color is error, they should have a color legend... anyway also I do not understand what is the problem with itemtype as well.

The actual code:

<header>
    <h1>
        <a itemprop="url" href="http://www.rovarvadasz.hu/"><img itemprop="logo" src="/images/header_bg.png" alt="Rovar Vadász"></a>
    </h1>
    <div id="contact" itemscope itemtype="http://schema.org/LocalBusiness">
        <p>
            <ul>
                <li>Telefon: <span itemprop="telephone"><a href="tel:0616303958">06 (1) 630-3958</a></span></li>
                <li>Nyitvatartás: munkanapokon <time itemprop="openingHours" datetime="09:00">9</time>-<time itemprop="openingHours" datetime="16:00">16</time> óráig</li>
                <li>Fax: <span itemprop="faxNumber">06 (1) 240-1546</span></li>
                <li>Mobil: <span itemprop="telephone"><a href="tel:06204224558">06 (20) 422-4558</a></span></li>
                <li>E-mail: <a href="mailto:info@rovarvadasz.hu" itemprop="email">info@rovarvadasz.hu</a></li>
            </ul>
        </p>
    </div>
</header>

Solution

  • Your errors are all minor but are caused by:

    1) The p tag is automatically closed by the client because it hits the <ul> tag, so in effect your statement is:

    <p> ... </p> <ul> ... </ul> </p>

    This is because List elements should not be sub-elements of Paragraph elements. So the client browser tries to fix this but has a left over </p>.

    2) Your line 75 itemprop is NOT within your div but is in the anchor within your header element. Your itemprop="logo" is free and not within any itemscope.

    3) I also saw other errors your elements where closed with /> which is unneeded on HTML5