I've a label
element whose contents needs some styling. This label can't be adjusted, so it would be handy to use a <div>
or block-level elements inside the label. So I'm wondering if it is valid to use a <div>
in a <label>
in HTML5.
the label element:
Content model:
Phrasing content, but with no descendant labelable elements unless it is the element's labeled control, and no descendant label elements.
phrasing content:
a abbr area (if it is a descendant of a map element) audio b bdi bdo br button canvas cite code data datalist del dfn em embed i iframe img input ins kbd keygen label map mark math meter noscript object output progress q ruby s samp script select small span strong sub sup svg template textarea time u var video wbr text
So no. Div elements may not be descendants of labels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With