HTML Tag Reference - HTML tag <span>








This <span> element is used to apply style sheet to the text.

Browser compatibility

<span> Yes Yes Yes Yes Yes

What's new in HTML5

None.

Global Attributes

The <span> tag supports the Global Attributes in HTML.

Event Attributes

The <span> tag supports the Event Attributes in HTML.

Default CSS Settings

None.





Example

A demo showing how to use <span> tag.

<html>
<body>
     <p>
          <span style="color: #FF0000;">paragraph</span>
          <span style="color: blue;">three </span> 
          <span style="color: blue;">styles </span>.
     </p>
</body>
</html>

Click to view the demo