0

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>
Ákos Nikházy
  • 1,276
  • 17
  • 33
  • 3
    Lists should not be held within p tags, the way the page is seeing it is p start, p end list start, list end, p end. as the list element is of equivalent rather than subordinate level to the p element. – Martin Feb 20 '15 at 08:48
  • So if I write an article that has a list in it in a paragraph that is also wrong? I just never knew this... so strange. – Ákos Nikházy Feb 20 '15 at 08:52
  • 1
    it's not strange, a paragraph element is for paragraphs of text, whereas list elements are for lists of data, they are fairly exclusive in that respect. It is something that works in all browsers because they apply their own fixes, but their fixes leave your written `` as a left over article and so causes errors on validation. – Martin Feb 20 '15 at 08:54
  • Also, you're mixing XHTML with HTML syntax. You should either omit the slash from empty tags (`` instead of ``) or use the XML syntax for Boolean attributes (`` instead of ``). I don't know if this is actually a validation issue, as HTML5 supports both syntaxes. – Brandon Gano Feb 20 '15 at 09:00
  • Part of the site's html comes from database I didn't come around to fix up. I want the whole thing HTML5 in time. For now I try to make my own part of the site work. But thank you for all the comments you guys are really helpful. – Ákos Nikházy Feb 20 '15 at 09:06

1 Answers1

1

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

Martin
  • 22,212
  • 11
  • 70
  • 132