Loading...
HTML <span> Tag

HTML <span> Tag

In this tutorial, we will learn about span tag in HTML with the help of examples.


<span> Tag

Span tag <span> is used for grouping and applying styles to inline elements.

Note : The <span> tag is used with inline elements while <div> tag is used with block-level content.

Syntax

<span>..........</span>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Span Tag</title>
  </head>
  <body>
      <p>This is black not <span style = "color:red;">red.</span></p>
  </body>
</html>

Output

This is black not red.


Global Attribute

Span Tag support all the global attributes of HTML.


Event Attribute

Span Tag support all the event attributes of HTML.


Next Tutorial

We hope that this tutorial helped you develop better understanding of the concept of <span> tag in HTML.

Keep Learning : )

In the next tutorial, you'll learn about HTML <strong> Tag.

- Related Topics