Siden er opdateret 20. 3. 2009
<span> anvendes til at sætte en inline afgrænsning på noget sideindhold - f.eks. for at sætte særlig css-definition på.
I html:
<p>Standard tekstfarve <span class="rt">Rød tekst</span>.</p>
I css:
.rt {
color: red;
background-color: inherit;
}
Vil på siden se sådan ud:
Standard tekstfarve Rød tekst.
<span> kan indeholdes i abbr, acronym, address, b, blockquote, big, cite, code, dd, del, dfn, div, dt, em, h1, h2, h3, h4, h5, h6, i, ins, kbd, label, legend, li, p, pre, q, s, samp, small, strike, strong, sub, sup, span, tt, u og var
<span> kan indeholde abbr, acronym, b, big, cite, code, del, dfn, em, font, i, ins, kbd, q, s, samp, small, span, strike, strong, sub, sup, span, tt, u og var
Attributter - ingen attributter er krævede, kun de fælles er valide i strict (x)html - brug i stedet css til at style <span>.