Can a label only refer to input elements?

后端 未结 4 1268
有刺的猬
有刺的猬 2021-02-13 11:16

W3Schools have this to say about labels:

The tag defines a label for an input element. [Emphasis mine]<

4条回答
  •  失恋的感觉
    2021-02-13 11:44

    I would say it was not an appropriate use of the markup, because label semantics are that they are specifically for controls.

    The LABEL element is used to specify labels for controls that do not have implicit labels,

    http://www.w3.org/TR/html401/interact/forms.html#h-17.9.1

提交回复
热议问题