HTML <span> (Text Span) Tag

❮ Previous Reference Next ❯


<p>This is <span style="color: red;">span</span> text</p>


The <span> inline element is used to group content so scripting or style rules can be applied to the enclosed content.

As it has no preset or rendering meaning, this is the most useful inline element for associating style and script with content.

The <span> element is especially useful for applying cascading style sheets (CSS) styles.

Version: HTML 4, 4.01, 5

Standard Syntax


Browser Support


Global Attributes

The <span> element also supports the Global Attributes in HTML.

Event Attributes

The <span> element also supports the Event Attributes in HTML.

By Default CSS Value(s)

Most of the browsers will display the <span> element with the following by default value(s)

span {
  display: inline;

❮ Previous Reference Next ❯