<span> Description:
The <span></span> tag allows you to provide localized formatting within documents.
<span> Web Browser Support:
- Netscape 4, 6, 7
- Mozilla 1
- Firefox 1
- Internet Explorer 4, 5, 6
- Opera 6, 7, 8
- Safari 1
- HTML 4.0
- XHTML 1.0: XHTML Text Module
<span> Attributes:
- class (optional)
- dir (optional)
- id (optional)
- lang (optional)
- onclick (optional)
- ondblclick (optional)
- onkeydown (optional)
- onkeypress (optional)
- onkeyup (optional)
- onmousedown (optional)
- onmouseout (optional)
- onmouseover (optional)
- onmouseup (optional)
- style (optional)
- title (optional)
<span> End Tag:
<span> Contents:
Usually any HTML text that you want to specify a style for. The following tags are valid within the <span> tag:
a, acronym, applet, b, basefont, bdo, big, br, button, cite, code, dfn, em, font, i, iframe, img, input, kbd, label, map, object, q, s, samp, script, select, small, span, strike, strong, sub, sup, textarea, tt, u, var
<span> Valid Context:
The <span> tag is valid within the following tags:
a, acronym, address, applet, b, bdo, big, blockquote, body, button, caption,
center, cite, code, dd, del, dfn, div, dt, em, fieldset, font, form, h1, h2, h3,
h4, h5, h6, i, iframe, ins, kbd, label, legend, li, noframes, noscript, object,
p, pre, q, s, samp, small, span, strike, strong, sub, sup, td, th, tt, u, var
<span> Usage:
- change style of text within a paragraph
<p>This is a paragraph with <span style="color : purple; text-decoration : line-through;">one short phrase</span> in purple, and crossed out.</p>
<span> Special Notes:
- Unlike the div tag, you can use span within paragraph tags, but you can't use it to group block elements, like you can with the div tag.
More <span> Information:
- <div></div>
- The <span> and <div>
Tags
Learn to use two useful style related tags. - XHTML CSS Layout Templates
If you don't have time to write your own XHTML CSS layouts, these templates will get you started.

