W3C home > Mailing lists > Public > www-validator@w3.org > November 2015

Re: Element section not allowed as child of element a in this context.

From: David Dorward <david@dorward.me.uk>
Date: Tue, 24 Nov 2015 16:21:27 +0000
To: "Michał Szczygieł" <kamsmichalszczygiel@gmail.com>
Cc: "www-validator@w3.org" <www-validator@w3.org>
Message-ID: <FCF805CB-728B-424C-8043-2FD8F55D712C@dorward.me.uk>
On 24 Nov 2015, at 11:38, Michał Szczygieł wrote:
> I have issue with "Element section not allowed as child of element a in
> this context."
> It is snippet of my code:

That snippet is valid.

> So it looks properly in my opinion, even specification confirms that.

The formal part of the specification says:

    Content model:
        Transparent, but there must be no interactive content descendant.

Which means that (with the exception of interact content) any element you could put in the place you have put a link, you can put inside the link.


    <div><a href="..."><section></section></a></div>

… is valid because you can have a section in a div but …

    <b><a href="..."><section></section></a></b>
… is not because you can't have a section inside a b.

You haven't shown us what the parent element of your `a` is, but it is something that you can't put a section inside.

David Dorward

Received on Tuesday, 24 November 2015 16:21:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:14 UTC