span
span
W3C Recommendation
Summary
Groups inline elements in a document. The span element is both style and semantics neutral; it does not assign any style attributes or semantic meaning on its own.
Overview Table
| DOM Interface | HTMLSpanElement |
|---|
Examples
This example uses the span element to create an inline text container that changes the color of a word to blue.
HTML
<p>This paragraph contains a single <span style="color: blue">blue</span> word.
This example uses the span element to add a simple Microformats2 h-card to a person's name.
HTML
<span class="h-card vcard">Pius Uzamere</span>
Notes
Remarks
The SPAN element is especially useful for applying cascading style sheets (CSS) styles.
Standards information
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.4
- HTML 4.01 Specification, Section 7.5.4
HTML information
{
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic Support | All versions All versions -webkit |
All versions All versions -moz |
All versions All versions -ms |
All versions All versions -o |
All versions All versions -webkit
|
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic Support | All versions All versions -webkit |
All versions All versions -webkit |
All versions All versions -webkit |
All versions All versions -moz |
All versions All versions -ms |
All versions All versions -o |
All versions All versions -o |
All versions All versions -webkit
|
See also
Related articles
HTML
- span
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here