About
The span element is a generic wrapper for phrasing content that by itself does not represent anything.
Span doesn't have explicit attributes.
Articles Related
Usage
Span is then handy to use:
- as placeholder for Javascript with the data attribute for instance.
- or to apply another style
Rendering
div elements are rendered as block boxes whereas span element are rendered as inline box.
Example:
- The world word will then stay on the same line (ie in the p block element.
<p>
Hallo <span style="color:green">World</span>
</p>
- Output: