HTML <span> Tag

Description

The universal line element <span> is intended to highlight individual lines, characters or other line elements to further change their appearance using styles. For example, inside a paragraph ( <p> ), you can change the color and size of the first word if you select it using the <span> element and set the desired style for it.

Properties

Permitted Parents
Any element that accepts phrasing content, or any element that accepts flow content
Content
Inline and text
Start/End Tags
Start tag: required, End tag: required

Example

The color of the sky is <span style="color:blue;">blue</span>

Attributes

None

Global Attributes

The <span> tag also supports the Global Attributes in HTML5

Event Attributes

The <span> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
YesYesYes1YesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4YesYesYes