Blog

The Span Tag in HTML

The use of a <span> tag changes the style of the text it encloses without any style attributes. The primary difference between the <span> and <div> tags is that <span> doesn’t do any formatting of it’s own. The <span> tag simply tells the browser to apply the style rules to whatever is within the <span>.

  • The <span> tag is used to group inline-elements in a document.
  • The <span> tag provides no visual change by itself.
  • The <span> tag provides a way to add a hook to a part of a text or a part of a document.

Text with a span element that can be styled with CSS. For example:

<p>My hke on the Long Trail offered time to <span>clear my thoughts</span> and enjoy being outside.</p>

No comments yet.

Leave a Reply