W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0y
4.0y
TV 1.2n
2.1n

<SPAN>...</SPAN>

Description

This element is used to create a structure in a document. By using this element you can give a part of the document a name, or apply style sheet information to the part.

The difference between this element and the DIV element is that the span element works inline, and the div element creates block-level content. With block-level content, most browsers surround the block by whitespace, starting at a new line.

DTD

<!ELEMENT SPAN - - (%inline;)*         -- generic language/style container -->
<!ATTLIST SPAN
  %attrs;                              -- %coreattrs, %i18n, %events --
  >
from the HTML 4.0 DTD, "Copyright © W3C, (MIT, INRIA, Keio). All Rights Reserved."

Attributes

Core attributes: class id style title
Internationalization attributes: dir lang
Events: onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup

Examples

Source
In the next lines the color and fontsizes of the text
has been set with style sheet elements:<BR>
<SPAN style="color: white">This line uses white text</SPAN><BR>
<SPAN style="font-size: 20pt">This is a font size of 20 points</SPAN>
 
Result
In the next lines the color and fontsizes of the text has been set with style sheet elements:
This line uses white text
This is a font size of 20 points
Statistics