The HTML <span> Tag

Definition and Usage

<span> A tag is a line content container used to mark a part of text or a part of a document.

<span> tags can be easily styled with CSS, and can also be manipulated using class or id attributes through JavaScript.

<span> The tag is similar to The <div> element very similar, but <div> Is a block-level element, while <span> Is an inline element.

See Also:

HTML Tutorial:HTML Block and Inline Elements

HTML DOM Reference Manual:Span Object

Example

Used to color part of the text <span> Element:

<p>This girl has a pair of <span style="color:blue">blue</span> eyes.</p>

Try It Yourself

Global Attributes

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

Event Attributes

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

Default CSS Settings

None.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support