This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
hello, i think tags such as <div> or <p> should be allowed inside <label> i would consider it like <a>, a focusable area that is not necessarily just a span of text note: browsers didn't modify the parser yet to follow the spec so the following syntax is in fact still allowed and functioning <label> <div>test</div> <input type="text"> </label> (tested all msies 6+, firefox, webkit based browsers) so, spec could be changed to follow the implementations. what do you think? I don't have an use case, but i think it's very common the usage of <div>, for example, inside <label>, especially for form styling
people put controls under label to link control and label together (in replace of @for attribute usage), it seems to be a general pattern
There is one important detail: Currently the spec says about <label>: ”Contexts in which this element can be used: Where phrasing content is expected.” But if block content is allowed as children of <label>, there would have to be a prohibition on nesting <p> elements: Contexts in which this element can be used: Where phrasing content is expected, EXCEPT that when <label> is a child of <p>, then there can be no <p> element children of the <label> element.
@Leif Halvard Silli I think it can be considered "transparent content" as spec says about the anchor tag > Transparent, but there must be no interactive content descendant. http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#transparent
(In reply to Giorgio from comment #3) > @Leif Halvard Silli > > I think it can be considered "transparent content" That sounds like the way to go.
HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/266 To file additional issues please use the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new Thanks!