The container tag <span>
The <span>
element is similar to the <div>
element — both are used to separate a part of the text to which you want to apply different styles. The <span>
element has no required attributes, but style
, class
, and id
are common. This element's only difference from the <div>
element is that it's an inline element — it doesn't force a line break and only takes up as much width as necessary.