Skip to content Skip to sidebar Skip to footer

Empty Heading Warning On HTML5 Validation

I try to validate my HTML code and I have found this warning: Empty heading. See here Obviously the heading is not empty. The content of the

is generated, in

Solution 1:

First off, the HTML is valid. It passes the W3C check, so you don't need to worry too much.

With that said, your code is misusing HTML syntax. The "empty heading" warning means that you have a heading tag (<hN>) that doesn't have any content associated with it. Heading tags are intended to mean "this is what this bit of content is about". As the HTML5 spec says:

The h1 through h6 elements are headings for the sections with which they are associated.

You are instead using the h3 tag as a formatting instruction. It has no content associated; the words are not actually the header for any content. This is misusing the semantics of the tag.

Does this matter? Probably not, though software which relies on the semantics of HTML rather than the appearance (e.g. screenreaders) might find it tricky. I'm not sure about how Wordpress works -- it might be very difficult to fix anyway.


Post a Comment for "Empty Heading Warning On HTML5 Validation"