Nothing is for sale here. Freewill tips keep the site running. Want to help? → Tip via Paypal
The Span Tag
The span element, like the division element, is a generic container. It doesn’t provide any formatting on its own, but unlike the block level division element, content within a span tag set does not start on a new line because it is an inline element.As with the division element, web authors can use CSS to define what happens to content within a span element.
The span element is often used to make changes to the display of text within the flow of content. The font tag used to cover this, but it has been deprecated and should no longer be used.
In place of the font tag you can make all the changes (and more) with a span tag that you could with a font tag by adding inline CSS or a CSS class or ID attribute. Here’s an example of how to use it:
Life is not about what you get, it's about what you <span style="color: #1530EA; font-size: 18px; font-weight: bold; text-decoration: underline;">become</span>.
And here's how that renders on the web page:
Life is not about what you get, it's about what you become.
I used a span tag to make the word "become" display in bold type, increase the font-size, underline the word, and change the text color to dark blue to give it extra, extra emphasis.
In addition to using the span element that, I could have also reduced the font size, change the font family (typeface), added a background color or image, or several other things.
There you go, Spano! Everything you wanted to know about the span tag but were afraid to ask.