HTML <span> Element
The <span> element can be used to alter a section of content, normally text, in order to make it stand out for whatever reason
from the surrounding text. By combining <span> elements with CSS styles colour and font can be altered, a backgound colour
applied and many other CSS effects can be used to highlight the contents of the <span> element.
The <span> element is used for styling inline content as opposed to the <div> element which can be
applied to block-level content.
Example code:
span.green{ color: green; font-weight:bold;}
The HTML
<span class="green">Here is some bold green text. </span>
Displays: Here is some bold green text.
Here are some other examples of how <span> can be used to change text. They can be applied through the
class attribute and an external style sheet or by using the style attribute inline:
{font-size:1.3em; color:#FF8C00;} css text effects
{background-color:#FFE600} css text effects
{text-transform: uppercase; color:olive; font-style:italic;} css text effects
{letter-spacing:3mm; font-variant:small-caps; } css text effects
<span> Attributes
- CORE AND LANGUAGE ATTRIBUTES - class, id, title, style, dir, lang
- EVENT ATTRIBUTES - onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmouseout, onmousemove, onkeydown, onkeyup, onkeypress
