Display:The <span> Element

The <span> element is an inline element that is often used as a container for bits of text. The <span> element has no required attributes, but style and class are commonly used. When combined with CSS, the <span> element can be used to style parts of the text:

HTML file: Displayed by browser:
<h1>My <span style="color:red">Important</span> Heading</h1>

My Important Heading

Oooh, cool! I didn't know this one! It's nice and simple!

Back button Table of Contents Next button