Can other labels be placed in a label?

Reference: The nesting rules of tags in HTML

1. HTML tags:

  1. Block element (block):
    • 常用:div、p、ul、ol、li、dl、dt、dd、fieldset、form、h1~h6、hr、table
    • Not commonly used: address, isindex, menu, noframes, noscript, pre, blockquote, center, dir
  2. Inline elements (inline)
    • 常用:span、a、b、strong、i、em、label、textarea、small、img、input
    • 不常用:abbr、acronym、bdo、big、br、cite、code、dfn、font、kbd、q、s、samp、select、strike、sub、sup、tt、u、var

2. Nesting rules

  1. Block elements can contain inline elements or some block elements, but inline elements cannot contain block elements, it can only contain other inline elements;
  2. There are several special block-level elements that can only contain embedded elements, and can no longer contain block-level elements. These special tags are: h1, h2, h3, h4, h5, h6, p, dt
  3. li can contain div tags;
  4. Block-level elements are juxtaposed with block-level elements, and embedded elements are juxtaposed with embedded elements;

3. Put the input tag in the a tag

The input tag can be placed in the a tag. But there will be some problems

Guess you like

Origin blog.csdn.net/weixin_43912756/article/details/108649048