W3Schools.com

HTML5 <span> Tag

Example

A text with a <span> element that is styled with CSS:

<p>My mother has <span style="color:lightblue">light blue</span> eyes.</p>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <span> tag is supported in all major browsers.


Definition and Usage

The <span> tag is used to group inline-elements in a document.

The <span> tag provides no visual change by itself.

The <span> tag provides a way to add a hook to a part of a text or a part of a document.

Tip: When a text is hooked in a <span> element you can add styles to the content, or manipulate the content with for example JavaScript.


Differences Between HTML 4.01 and HTML5

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.


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE