<SPAN> | NN 4 IE 3 HTML 4 | ||
<SPAN>...</SPAN> | HTML End Tag: Required | ||
The span element gives structure and context to any inline content in a document. Unlike some other structural elements that have very specific connotations attached to them (the p element, for instance), the author is free to give meaning to each particular span element by virtue of the element's attribute settings and nested content. Each span element becomes a generic container for all content within the required start and end tags. It is convenient to use the span element as a wrapper for a small inline chunk of content that is to be governed by a style sheet rule. For example, if you want to differentiate a few words in a paragraph with the equivalent of a small caps look, you would wrap the affected words with a span element whose style sheet defines the requested font and text styles. Such a style sheet could be defined as an inline style attribute of the span element or assigned via the class or id attribute depending on the structure of the rest of the document. If you need an arbitrary container for block-level content, use the div element. |
|||
Example | |||
<SPAN style="font-size:10pt; text-transform:uppercase"> 30-day special offer</SPAN> |
|||
Object Model Reference | |||
[window.]document.getElementById(elementID)
|
|||
Element-Specific Attributes | |||
|
|||
Element-Specific Event Handler Attributes | |||
None. |
datafld | NN n/a IE 4 HTML |4| |
datafld="columnName" | Optional |
Used with IE data binding to associate a remote data source column name with the HTML content of a span element. The data source column must be HTML (see dataformatas). datasrc and dataformatas attributes must also be set for the span element. Works only with text file data sources in IE 5/Mac. This attribute was reserved in HTML 4, but was dropped in XHTML 1.0. |
|
Example | |
<SPAN datasrc="DBSRC3" datafld="quote" dataformatas="HTML">...</SPAN> |
|
Value | |
Case-sensitive identifier. |
|
Default | |
None. |
|
Object Model Reference | |
[window.]document.getElementById(elementID).dataFld
|
dataformatas | NN n/a IE 4 HTML |4| |
dataformatas="dataType" | Optional |
Used with IE data binding, this attribute advises the browser whether the source material arriving from the data source is to be treated as plain text or as tagged HTML. A span element should receive data only in HTML format. This attribute was reserved in HTML 4, but was dropped in XHTML 1.0. |
|
Example | |
<SPAN datasrc="DBSRC3" datafld="quote" dataformatas="HTML">...</SPAN> |
|
Value | |
Case-insensitive constants: html | text. |
|
Default | |
text |
|
Object Model Reference | |
[window.]document.getElementById(elementID).dataFormatAs
|
datasrc | NN n/a IE 4 HTML |4| |
datasrc="dataSourceName" | Optional |
Used with IE data binding to specify the ID of the page's object element that loads the data source object for remote data access. Content from the data source is specified via the datafld attribute. Works only with text file data sources in IE 5/Mac. This attribute was reserved in HTML 4, but was dropped in XHTML 1.0. |
|
Example | |
<SPAN datasrc="DBSRC3" datafld="quote" dataformatas="HTML">...</SPAN> |
|
Value | |
Case-sensitive identifier. |
|
Default | |
None. |
|
Object Model Reference | |
[window.]document.getElementById(elementID).dataSrc
|
lang | NN 3 IE 4 HTML 4 |
lang="languageCode" | Optional |
The language being used for the element's attribute values and content. A browser can use this information to assist in proper rendering of content with respect to details such as treatment of ligatures (when supported by a particular font or required by a written language), quotation marks, and hyphenation. Other applications and search engines might use this information to aid the selection of spell-checking dictionaries and the creation of indices. |
|
Example | |
<SPAN lang="de">Deutsche Bundesbahn</SPAN> |
|
Value | |
Case-insensitive language code. |
|
Default | |
Browser default. |
|
Object Model Reference | |
[window.]document.getElementById(elementID).lang
|