2.18 span Element
The span element (like the div block element) has no innate characteristics, either with regard to content or with regard to presentation. Its presentation characteristics are given to it explicitly by CSS. If you want to apply formatting to some text, and the text doesn’t coincide with one of the other container elements, then put the text in a span element and apply CSS to the span element.
The next chapter covers CSS in depth, and many of the CSS examples will use the span element. For now, here’s a brief overview of the span element.
Think about the u element presented in the previous section. As you know, the u element is frowned upon. For underlining, you should normally avoid using the u element; instead, surround ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access