The <span> element is an inline element.
An inline element does not start on a new line and only takes up as much width as necessary.
Example of inline element: <i>,<a>,<b> etc.
HTML Span Tag tag does not give any special appearance on web page like <b> tag, <i> tag etc gives. It generally used as a container for HTML elements.
Like if we want to change the color of 4 words together then we can use a <span> tag to cover all text in one.
Run the code to see the effect.
Div Tag takes the full width of the screen and Span Tag takes only as much as required to cover the content.
Run the code to see the effect.
Run the code to see the effect.
Run the code to see the effect.