HTML <span> Tag


The <span> HTML tag is an inline element used to apply styling or manipulate specific portions of text within a larger block of content, such as a paragraph or a heading. It does not add any structural significance to the content but serves as a container for applying CSS styles, JavaScript interactions, or other formatting changes. Developers often use the <span> tag to change text color, font size, apply inline CSS, or target specific text for scripting purposes, making it a versatile tool for fine-grained control over the presentation and behavior of text within a web page.


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


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



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

The following table will show you the current browser support for the HTML <span> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th September 2023