The Span Tag

ken's picture

Opening tag : <Span>
Closing tag: </Span>

Purpose:
The Span tag is useful for adding style details across a Span of text. It is very similar to the DIV tag, which allows styles to be set for a division of the webpage, the key difference is that Span doesn't include a line break so it can affect part of a sentence.

Attributes:
Class=class
- Specifies a style class to use for formatting.

Dir=direction
- Useful for Languages which should be read from right to left.

Event=Javascript
- Allows a Javascript to be assigned to an event.

ID=Name
- Giving a Span an id allows it to be referenced or changed dynamically.

Lang=language
- Specifies a language for the text within the Span.

nowrap
- Stops the wrapping of text.

Style=style
- Allocates a style to the text, overwriting other style settings.

Title=title
- Span tags also have a title tag, in case you need to add more information about it.

Example:

We can change things in the <Span class="style1">middle of a </Span> sentence.

Related Tags:

<div></div> - Divide Tag.

Back to:
Alphabetical Guide
Guide By Type