Div and Span
In layman's words, if there are other tags in the time use Div, if only text inside should use span
Span and label
With the above statement about span, we can manipulate the span of the text, define CSS styles and so on, but the label seems to do the same. But what is the difference sometimes?
Label labels are primarily used to bind a form element, and when a label is clicked, the bound form element gets the input focus
span is a container for plain text.
Attached: The specific use of label tags:
For property:
Function: Represents the HTML element to which the label tag is bound, and when you click on the tag, the bound element will get the focus
AccessKey Properties:
Function: Represents the hotkey that accesses the element to which the label tag is bound, and when you press the hotkey, the bound element gets the focus.
The difference between a Div, span, label label in HTML