<s>
In	O
HTML	B-Language
,	O
div	B-General_Concept
and	I-General_Concept
span	I-General_Concept
tags	B-General_Concept
are	O
elements	O
used	O
to	O
define	O
parts	O
of	O
a	O
document	O
,	O
so	O
that	O
they	O
are	O
identifiable	O
when	O
a	O
unique	O
classification	O
is	O
necessary	O
.	O
</s>
<s>
Where	O
other	O
HTML	B-General_Concept
elements	I-General_Concept
such	O
as	O
p	O
(	O
paragraph	O
)	O
,	O
em	O
(	O
emphasis	O
)	O
,	O
and	O
so	O
on	O
,	O
accurately	O
represent	O
the	O
semantics	O
of	O
the	O
content	O
,	O
the	O
additional	O
use	O
of	O
span	B-General_Concept
and	I-General_Concept
div	I-General_Concept
tags	B-General_Concept
leads	O
to	O
better	O
accessibility	O
for	O
readers	O
and	O
easier	O
maintainability	O
for	O
authors	O
.	O
</s>
<s>
Where	O
no	O
existing	O
HTML	B-General_Concept
element	I-General_Concept
is	O
applicable	O
,	O
span	B-General_Concept
and	I-General_Concept
div	I-General_Concept
can	O
valuably	O
represent	O
parts	O
of	O
a	O
document	O
so	O
that	O
HTML	B-General_Concept
attributes	I-General_Concept
such	O
as	O
class	O
,	O
id	O
,	O
lang	O
,	O
or	O
dir	O
can	O
be	O
applied	O
.	O
</s>
<s>
div	B-General_Concept
represents	O
a	O
block-level	O
portion	O
of	O
a	O
document	O
such	O
as	O
a	O
few	O
paragraphs	O
,	O
or	O
an	O
image	O
with	O
its	O
caption	O
.	O
</s>
<s>
div	B-General_Concept
stands	O
for	O
division	O
.	O
</s>
<s>
The	O
elements	O
allow	O
semantic	O
attributes	B-General_Concept
(	O
e.g.	O
</s>
<s>
lang	O
=	O
"	O
en-US	O
"	O
)	O
,	O
CSS	B-Language
styling	I-Language
(	O
e.g.	O
,	O
color	O
and	O
typography	O
)	O
,	O
or	O
client-side	O
scripting	O
(	O
e.g.	O
,	O
animation	O
,	O
hiding	O
,	O
and	O
augmentation	O
)	O
to	O
be	O
applied	O
.	O
</s>
<s>
The	O
span	B-General_Concept
element	I-General_Concept
was	O
introduced	O
to	O
HTML	B-Language
in	O
the	O
internationalization	O
working	O
group	O
's	O
second	O
draft	O
in	O
1995	O
.	O
</s>
<s>
However	O
,	O
it	O
was	O
not	O
until	O
HTML	B-Language
4.01	I-Language
that	O
it	O
became	O
part	O
of	O
the	O
HTML	B-Language
language	I-Language
,	O
appearing	O
in	O
the	O
HTML	B-Language
4	O
W3C	O
Working	O
Draft	O
in	O
1997	O
.	O
</s>
<s>
In	O
1995	O
,	O
span	O
was	O
introduced	O
to	O
mark	O
up	O
any	O
inline	O
span	O
of	O
text	O
,	O
because	O
'	O
a	O
generic	O
container	O
is	O
needed	O
to	O
carry	O
the	O
LANG	O
and	O
BIDI	O
attributes	B-General_Concept
in	O
cases	O
where	O
no	O
other	O
element	O
is	O
appropriate.	O
'	O
</s>
<s>
It	O
still	O
serves	O
that	O
general	O
purpose	O
,	O
although	O
a	O
much	O
richer	O
range	O
of	O
semantic	O
elements	O
have	O
been	O
defined	O
since	O
then	O
,	O
and	O
there	O
are	O
also	O
many	O
more	O
attributes	B-General_Concept
that	O
may	O
need	O
to	O
be	O
applied	O
.	O
</s>
<s>
div	B-General_Concept
defines	O
a	O
'	O
division	O
 '	O
of	O
the	O
document	O
,	O
a	O
block-level	O
item	O
that	O
is	O
more	O
distinct	O
from	O
elements	O
above	O
and	O
below	O
it	O
than	O
a	O
span	O
of	O
inline	O
material	O
.	O
</s>
<s>
There	O
are	O
multiple	O
differences	O
between	O
div	B-General_Concept
and	I-General_Concept
span	I-General_Concept
.	O
</s>
<s>
In	O
standard	O
HTML	B-Language
,	O
a	O
div	B-General_Concept
is	O
a	O
block-level	O
element	O
whereas	O
a	O
span	O
is	O
an	O
inline	O
element	O
.	O
</s>
<s>
The	O
div	B-General_Concept
block	I-General_Concept
visually	O
isolates	O
a	O
section	O
of	O
a	O
document	O
on	O
the	O
page	O
,	O
and	O
may	O
contain	O
other	O
block-level	O
components	O
.	O
</s>
<s>
The	O
span	B-General_Concept
element	I-General_Concept
contains	O
a	O
piece	O
of	O
information	O
inline	O
with	O
the	O
surrounding	O
content	O
,	O
and	O
may	O
only	O
contain	O
other	O
inline-level	O
components	O
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
default	O
display	O
of	O
the	O
elements	O
can	O
be	O
changed	O
by	O
the	O
use	O
of	O
Cascading	B-Language
Style	I-Language
Sheets	I-Language
(	O
CSS	B-Language
)	O
,	O
although	O
the	O
permitted	O
contents	O
of	O
each	O
element	O
may	O
not	O
be	O
changed	O
.	O
</s>
<s>
For	O
example	O
,	O
regardless	O
of	O
CSS	B-Language
,	O
a	O
span	B-General_Concept
element	I-General_Concept
may	O
not	O
contain	O
block-level	O
children	O
.	O
</s>
<s>
span	B-General_Concept
and	I-General_Concept
div	I-General_Concept
elements	I-General_Concept
are	O
used	O
purely	O
to	O
imply	O
a	O
logical	O
grouping	O
of	O
enclosed	O
elements	O
.	O
</s>
<s>
There	O
are	O
three	O
main	O
reasons	O
to	O
use	O
span	B-General_Concept
and	I-General_Concept
div	I-General_Concept
tags	B-General_Concept
with	O
class	O
or	O
id	O
attributes	B-General_Concept
:	O
</s>
<s>
It	O
is	O
common	O
for	O
and	O
elements	O
to	O
carry	O
class	O
or	O
id	O
attributes	B-General_Concept
in	O
conjunction	O
with	O
CSS	B-Language
to	O
apply	O
layout	O
,	O
typographic	O
,	O
color	O
,	O
and	O
other	O
presentation	O
attributes	B-General_Concept
to	O
parts	O
of	O
the	O
content	O
.	O
</s>
<s>
CSS	B-Language
does	O
not	O
just	O
apply	O
to	O
visual	O
styling	O
:	O
when	O
spoken	O
out	O
loud	O
by	O
a	O
voice	B-Protocol
browser	I-Protocol
,	O
CSS	B-Language
styling	I-Language
can	O
affect	O
speech-rate	O
,	O
stress	O
,	O
richness	O
and	O
even	O
position	O
within	O
a	O
stereophonic	O
image	O
.	O
</s>
<s>
For	O
these	O
reasons	O
,	O
and	O
in	O
support	O
of	O
a	O
more	O
semantic	O
web	O
,	O
attributes	B-General_Concept
attached	O
to	O
elements	O
within	O
HTML	B-Language
should	O
describe	O
their	O
semantic	O
purpose	O
,	O
rather	O
than	O
merely	O
their	O
intended	O
display	O
properties	O
in	O
one	O
particular	O
medium	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
HTML	B-Language
in	O
is	O
semantically	O
weak	O
,	O
whereas	O
uses	O
an	O
em	O
element	O
to	O
signify	O
emphasis	O
(	O
appearing	O
as	O
text	O
in	O
italics	O
)	O
,	O
and	O
introduces	O
a	O
more	O
appropriate	O
class	O
name	O
.	O
</s>
<s>
By	O
the	O
correct	O
use	O
of	O
CSS	B-Language
,	O
such	O
'	O
warnings	O
 '	O
may	O
be	O
rendered	O
in	O
a	O
red	O
,	O
bold	O
font	O
on	O
a	O
screen	O
,	O
but	O
when	O
printed	O
out	O
they	O
may	O
be	O
omitted	O
,	O
as	O
by	O
then	O
it	O
is	O
too	O
late	O
to	O
do	O
anything	O
about	O
them	O
.	O
</s>
<s>
Even	O
today	O
's	O
search	O
engines	O
such	O
as	O
Google	B-Application
and	O
others	O
use	O
proprietary	O
information	O
processing	O
algorithms	O
of	O
considerable	O
complexity	O
.	O
</s>
<s>
The	O
microformats	B-General_Concept
movement	O
is	O
an	O
attempt	O
to	O
build	O
an	O
idea	O
of	O
semantic	O
classes	O
.	O
</s>
<s>
For	O
example	O
,	O
microformats-aware	O
software	O
might	O
automatically	O
find	O
an	O
element	O
like	O
and	O
allow	O
for	O
automatic	O
dialing	O
of	O
the	O
telephone	O
number	O
.	O
</s>
<s>
Once	O
the	O
HTML	B-Language
or	O
XHTML	O
markup	O
is	O
delivered	O
to	O
a	O
page-visitor	O
'	O
s	O
client	O
browser	O
,	O
there	O
is	O
a	O
chance	O
that	O
client-side	O
code	O
will	O
need	O
to	O
navigate	O
the	O
internal	O
structure	O
(	O
or	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
)	O
of	O
the	O
web	O
page	O
.	O
</s>
<s>
The	O
most	O
common	O
reason	O
for	O
this	O
is	O
that	O
the	O
page	O
is	O
delivered	O
with	O
client-side	O
JavaScript	B-Language
that	O
will	O
produce	O
on-going	O
dynamic	O
behaviour	O
after	O
the	O
page	O
is	O
rendered	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
rolling	O
the	O
mouse	O
over	O
a	O
'	O
Buy	O
now	O
 '	O
link	O
is	O
meant	O
to	O
make	O
the	O
price	O
,	O
elsewhere	O
on	O
the	O
page	O
,	O
become	O
emphasized	O
,	O
JavaScript	B-Language
code	O
can	O
do	O
this	O
,	O
but	O
JavaScript	B-Language
needs	O
to	O
identify	O
the	O
price	O
element	O
,	O
wherever	O
it	O
is	O
in	O
the	O
markup	O
.	O
</s>
<s>
Another	O
example	O
is	O
the	O
Ajax	B-General_Concept
programming	I-General_Concept
technique	O
,	O
where	O
,	O
for	O
example	O
,	O
clicking	O
a	O
hypertext	O
link	O
may	O
cause	O
JavaScript	B-Language
code	O
to	O
retrieve	O
the	O
text	O
for	O
a	O
new	O
price	O
quotation	O
to	O
display	O
in	O
place	O
of	O
the	O
current	O
one	O
within	O
the	O
page	O
,	O
without	O
re-loading	O
the	O
whole	O
page	O
.	O
</s>
<s>
When	O
the	O
new	O
text	O
arrives	O
back	O
from	O
the	O
server	O
,	O
the	O
JavaScript	B-Language
must	O
identify	O
the	O
exact	O
region	O
on	O
the	O
page	O
to	O
replace	O
with	O
the	O
new	O
information	O
.	O
</s>
<s>
Automatic	O
testing	O
tools	O
also	O
may	O
need	O
to	O
navigate	O
web	O
page	O
markup	O
using	O
span	B-General_Concept
and	I-General_Concept
div	I-General_Concept
elements	I-General_Concept
 '	O
class	O
or	O
id	O
attributes	B-General_Concept
.	O
</s>
<s>
In	O
dynamically	O
generated	O
HTML	B-Language
,	O
this	O
may	O
include	O
the	O
use	O
of	O
page	O
testing	O
tools	O
such	O
as	O
HttpUnit	B-Language
,	O
a	O
member	O
of	O
the	O
xUnit	B-Library
family	O
,	O
and	O
load	O
or	O
stress	O
testing	O
tools	O
such	O
as	O
Apache	B-Language
JMeter	I-Language
when	O
applied	O
to	O
form-driven	B-General_Concept
web	O
sites	O
.	O
</s>
<s>
The	O
judicious	O
use	O
of	O
div	B-General_Concept
and	I-General_Concept
span	I-General_Concept
is	O
a	O
vital	O
part	O
of	O
HTML	B-Language
and	O
XHTML	O
markup	O
.	O
</s>
<s>
Various	O
list	B-General_Concept
structures	O
available	O
in	O
HTML	B-Language
may	O
be	O
preferable	O
to	O
a	O
home-made	O
mixture	O
of	O
div	B-General_Concept
and	I-General_Concept
span	I-General_Concept
elements	O
.	O
</s>
<s>
Other	O
examples	O
of	O
the	O
semantic	O
use	O
of	O
HTML	B-Language
rather	O
than	O
div	B-General_Concept
and	I-General_Concept
span	I-General_Concept
elements	O
include	O
the	O
use	O
of	O
fieldset	O
elements	O
to	O
divide	O
up	O
a	O
web	B-General_Concept
form	I-General_Concept
,	O
the	O
use	O
of	O
legend	O
elements	O
to	O
identify	O
such	O
divisions	O
and	O
the	O
use	O
of	O
label	O
to	O
identify	O
form	O
input	O
elements	O
rather	O
than	O
div	B-General_Concept
,	O
span	O
or	O
table	O
elements	O
used	O
for	O
such	O
purposes	O
.	O
</s>
<s>
HTML5	B-Application
introduced	O
several	O
new	O
elements	O
;	O
a	O
few	O
examples	O
include	O
the	O
header	O
,	O
footer	O
,	O
nav	O
and	O
figure	O
elements	O
.	O
</s>
<s>
The	O
use	O
of	O
semantically	O
appropriate	O
elements	O
provides	O
better	O
structure	O
to	O
HTML	B-Language
documents	O
than	O
span	O
or	O
div	B-General_Concept
.	O
</s>
