W3C HTML Validator accuses "Empty heading"

10

I'm trying to validate my html and it's giving me the following message:

Line 328, Column 34: Empty heading.
<h3 class="titulo-chamada">A internet no controle</h3>

You have implied that the title is empty, but see that it has a content.

Link to html in codepen

    
asked by anonymous 03.06.2014 / 19:28

3 answers

9

The meaning of "empty" in this case is not that the tag has no content; is that this tag does not reference a section. The semantic meaning of a header is that it is "the header of a section", not simply a formatting option (such as strong or em ).

See this question in SOen for more details. I am still researching what should be done to fix this, when I find out post here.

Update: In your case, the use of the header within a article would be correct, the problem seems to be that article is within figure . There are several uses for this element , but I do not know the consequences of using it that way. So one way to solve this problem would be to put this article somewhere else (for example in a div , as you say you did successfully in the comments).

    
03.06.2014 / 19:34
5

I keep the W3C HTML5 Validator. The problem you reported is caused by a bug in the validator code. It is not the expected behavior. The <h3> is certainly not empty, so the error message is wrong indeed. I'll try to fix this bug soon. Thanks for realizing the problem.

I'm the maintainer of the W3C HTML5 validator. The problem reported here is caused by a bug in the validator sources. It's not intended behavior. The <h3> is definitely not empty. In this case the error message is just wrong. I will try to fix this validator bug soon. Thanks for catching it.

    
04.06.2014 / 15:49
3

I think I get it. Semantically it's not right to put h3 inside a tag figure. If I change the figure tag and use div , it solves the problem.

<!DOCTYPE html>
    <html class="no-js">
        <head>
            <meta charset="UTF-8">
            <title>Teste</title>
        </head>
        <body>
            <figure class="chamada-banner grid grid-8-12">
                <article class="chamada-box">
                    <span class="categoria">Ponto de vista</span>
                    <span class="description">Entrevista</span>
                    <h3 class="titulo-chamada">A internet no controle</h3>
                    <p>Atualmente, publicam-se on line muito mais informações sobre nós mesmos     do que jamai antes, todos estes dados estão sendo coletados por organizações...</p>
                </article>
            </figure>
        </body>
    </html>

Removing the figure tag and using a div resolves.

<!DOCTYPE html>
<html class="no-js">
    <head>
        <meta charset="UTF-8">
        <title>Teste</title>
    </head>
    <body>
        <div class="chamada-banner grid grid-8-12">
            <article class="chamada-box">
                <span class="categoria">Ponto de vista</span>
                <span class="description">Entrevista</span>
                <h3 class="titulo-chamada">A internet no controle</h3>
                <p>Atualmente, publicam-se on line muito mais informações sobre nós mesmos do que jamai antes, todos estes dados estão sendo coletados por organizações...</p>
            </article>
        </div >
    </body>
</html>

Or you can use span instead of h3 , if I want to use the figure tag.

<!DOCTYPE html>
    <html class="no-js">
        <head>
            <meta charset="UTF-8">
            <title>Teste</title>
        </head>
        <body>
            <figure class="chamada-banner grid grid-8-12">
                <article class="chamada-box">
                    <span class="categoria">Ponto de vista</span>
                    <span class="description">Entrevista</span>
                    <span class="titulo-chamada">A internet no controle</span>
                    <p>Atualmente, publicam-se on line muito mais informações sobre nós mesmos     do que jamai antes, todos estes dados estão sendo coletados por organizações...</p>
                </article>
            </figure>
        </body>
    </html>
    
04.06.2014 / 00:58