<span> tag is used as a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate.
<span> is very much like a
<div> element, but
<div> is a block-level element whereas a
<span> is an inline element.
The only content permitted inside this element is phrasing content. Both the starting and ending tag are mandatory for this element. The parent of the
<span> tag can be any element that accepts phrasing content, or any element that accepts flow content.
Here is an example of using this tag:
This element only accepts global attributes.
- Read more about the HTML
<span>element on MDN.
- You can also read the HTML
<span>tag reference on W3C.
2. As a registered user, you will also get to access features like choosing between a light and dark theme or anything else that we might implement in future.