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: Michał Szczygieł <kamsmichalszczygiel@gmail.com>
Date: Wed, 25 Nov 2015 07:36:22 +0000
Message-ID: <CAF-g-_rLfMNPwNWOfXKKMhaN9i0iW=jefx2HrKL=MhfOtKxi8g@mail.gmail.com>
To: David Dorward <david@dorward.me.uk>
Cc: "www-validator@w3.org" <www-validator@w3.org>
This is a more extensive piece of code:

....
<ul>
....
<li class="item">

    <div class="list-left">
        <div class="sale-label">Promocja</div>
        <div class="product-image">
            <a href="p1705,zircon-i-helm-ochronny-7-kolorow.html"><img
alt="ZIRCON I - hełm ochronny 7 kolorów." title="ZIRCON I - hełm ochronny 7
kolorów." src="galerie/h/helm-ochronny-zircon-i_3239_k.jpg"
class="miniatura"></a>
        </div>
    </div>

    <div class="list-center">
        <div class="product-shop">
            <div class="f-fix">
                <h2 class="product-name">
                    <a href="p1705,zircon-i-helm-ochronny-7-kolorow.html"
title="ZIRCON I - hełm ochronny 7 kolorów.">
                         <section>
                             <div class="name-wrapper">ZIRCON I - hełm
ochronny 7 kolorów.</div>
                         </section>
                    </a>
                </h2>
....
   </div>
</div>
    </div>
</li>
....

The section element is not a problem, because I used this as a example from
specification.
After removed the section element the error is similar but refers to div
element.




wt., 24.11.2015 o 17:21 użytkownik David Dorward <david@dorward.me.uk>
napisał:

> 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.
>
> So:
>
> <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
> http://dorward.co.uk/
>
-- 
Z wyrazami szacunku,
Michał Szczygieł
Received on Wednesday, 25 November 2015 07:41:29 UTC

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