<s>
In	O
web	O
development	O
,	O
the	O
CSS	B-Language
box	O
model	O
refers	O
to	O
how	O
HTML	B-Language
elements	O
are	O
modeled	O
in	O
browser	B-Protocol
engines	I-Protocol
and	O
how	O
the	O
dimensions	O
of	O
those	O
HTML	B-Language
elements	O
are	O
derived	O
from	O
CSS	B-Language
properties	O
.	O
</s>
<s>
It	O
is	O
a	O
fundamental	O
concept	O
for	O
the	O
composition	O
of	O
HTML	B-Language
webpages	O
.	O
</s>
<s>
The	O
guidelines	O
of	O
the	O
box	O
model	O
are	O
described	O
by	O
web	O
standards	O
World	O
Wide	O
Web	O
Consortium	O
(	O
W3C	O
)	O
specifically	O
the	O
CSS	B-Language
Working	O
Group	O
.	O
</s>
<s>
With	O
the	O
advent	O
of	O
CSS2	B-Language
in	O
1998	O
,	O
which	O
introduced	O
the	O
box-sizing	O
property	O
,	O
the	O
problem	O
had	O
mostly	O
been	O
resolved	O
.	O
</s>
<s>
The	O
Cascading	B-Language
Style	I-Language
Sheets	I-Language
(	O
CSS	B-Language
)	O
specification	O
describes	O
how	O
elements	O
of	O
web	O
pages	O
are	O
displayed	O
by	O
graphical	O
browsers	O
.	O
</s>
<s>
Section	O
4	O
of	O
the	O
CSS1	B-Language
specification	O
defines	O
a	O
"	O
formatting	O
model	O
"	O
that	O
gives	O
block-level	O
elements	O
—	O
such	O
as	O
p	O
and	O
blockquote	O
—	O
a	O
width	O
and	O
height	O
,	O
and	O
three	O
levels	O
of	O
boxes	O
surrounding	O
it	O
:	O
padding	O
,	O
borders	O
,	O
and	O
margins	O
.	O
</s>
<s>
All	O
HTML	B-Language
elements	O
can	O
be	O
considered	O
"	O
boxes	O
"	O
,	O
this	O
includes	O
div	O
tag	O
,	O
p	O
tag	O
,	O
or	O
a	O
tag	O
.	O
</s>
<s>
According	O
to	O
the	O
CSS1	B-Language
specification	O
,	O
released	O
by	O
W3C	O
in	O
1996	O
and	O
revised	O
in	O
1999	O
,	O
when	O
a	O
width	O
or	O
height	O
is	O
explicitly	O
specified	O
for	O
any	O
block-level	O
element	O
,	O
it	O
should	O
determine	O
only	O
the	O
width	O
or	O
height	O
of	O
the	O
visible	O
element	O
,	O
with	O
the	O
padding	O
,	O
borders	O
,	O
and	O
margins	O
applied	O
afterward	O
.	O
</s>
<s>
CSS3	O
introduced	O
the	O
Internet	B-Application
Explorer	I-Application
box	O
model	O
to	O
the	O
standard	O
,	O
known	O
referred	O
to	O
as	O
border-box	O
.	O
</s>
<s>
Before	O
HTML	B-Language
4	O
and	O
CSS	B-Language
,	O
very	O
few	O
HTML	B-Language
elements	O
supported	O
both	O
border	O
and	O
padding	O
,	O
so	O
the	O
definition	O
of	O
the	O
width	O
and	O
height	O
of	O
an	O
element	O
was	O
not	O
very	O
contentious	O
.	O
</s>
<s>
The	O
HTML	B-Language
width	O
attribute	O
of	O
a	O
table	O
defined	O
the	O
width	O
of	O
the	O
table	O
including	O
its	O
border	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
the	O
HTML	B-Language
width	O
attribute	O
of	O
an	O
image	O
defined	O
the	O
width	O
of	O
the	O
image	O
itself	O
(	O
inside	O
any	O
border	O
)	O
.	O
</s>
<s>
Width	O
for	O
the	O
cell	O
was	O
defined	O
as	O
"	O
the	O
suggested	O
width	O
for	O
a	O
cell	O
content	O
in	O
pixels	B-Algorithm
excluding	O
the	O
cell	O
padding.	O
"	O
</s>
<s>
In	O
1996	O
,	O
CSS	B-Language
introduced	O
margin	O
,	O
border	O
and	O
padding	O
for	O
many	O
more	O
elements	O
.	O
</s>
<s>
The	O
two	O
major	O
browsers	O
at	O
the	O
time	O
,	O
Netscape	B-Protocol
4.0	I-Protocol
and	O
Internet	B-Protocol
Explorer	I-Protocol
4.0	I-Protocol
both	O
defined	O
width	O
and	O
height	O
as	O
the	O
distance	O
from	O
border	O
to	O
border	O
.	O
</s>
<s>
This	O
has	O
been	O
referred	O
to	O
as	O
the	O
traditional	O
or	O
the	O
Internet	B-Application
Explorer	I-Application
box	O
model	O
.	O
</s>
<s>
Internet	B-Application
Explorer	I-Application
in	O
"	O
quirks	B-General_Concept
mode	I-General_Concept
"	O
includes	O
the	O
content	O
,	O
padding	O
and	O
borders	O
within	O
a	O
specified	O
width	O
or	O
height	O
;	O
this	O
results	O
in	O
a	O
narrower	O
or	O
shorter	O
rendering	O
of	O
a	O
box	O
than	O
would	O
result	O
following	O
the	O
standard	O
behavior	O
.	O
</s>
<s>
The	O
Internet	B-Application
Explorer	I-Application
box	O
model	O
behavior	O
was	O
often	O
considered	O
a	O
bug	O
,	O
because	O
of	O
the	O
way	O
in	O
which	O
earlier	O
versions	O
of	O
Internet	B-Application
Explorer	I-Application
handle	O
the	O
box	O
model	O
or	O
sizing	O
of	O
elements	O
in	O
a	O
web	O
page	O
,	O
which	O
differs	O
from	O
the	O
standard	O
way	O
recommended	O
by	O
the	O
W3C	O
for	O
the	O
Cascading	B-Language
Style	I-Language
Sheets	I-Language
language	O
.	O
</s>
<s>
As	O
of	O
Internet	B-Application
Explorer	I-Application
6	I-Application
,	O
the	O
browser	O
supports	O
an	O
alternative	O
rendering	O
mode	O
(	O
called	O
the	O
"	O
standards-compliant	O
mode	O
"	O
)	O
which	O
solves	O
this	O
discrepancy	O
.	O
</s>
<s>
However	O
,	O
for	O
backward	O
compatibility	O
reasons	O
,	O
all	O
versions	O
still	O
behave	O
in	O
the	O
usual	O
,	O
non-standard	O
way	O
by	O
default	O
(	O
see	O
quirks	B-General_Concept
mode	I-General_Concept
)	O
.	O
</s>
<s>
Internet	B-Protocol
Explorer	I-Protocol
for	I-Protocol
Mac	I-Protocol
is	O
not	O
affected	O
by	O
this	O
non-standard	O
behavior	O
.	O
</s>
<s>
Internet	B-Application
Explorer	I-Application
versions	O
6	B-Application
and	O
onward	O
are	O
not	O
affected	O
by	O
the	O
bug	O
if	O
the	O
page	O
contains	O
certain	O
HTML	B-Language
document	O
type	O
declarations	O
.	O
</s>
<s>
These	O
versions	O
maintain	O
the	O
buggy	O
behavior	O
when	O
in	O
quirks	B-General_Concept
mode	I-General_Concept
for	O
reasons	O
of	O
backward	O
compatibility	O
.	O
</s>
<s>
For	O
example	O
,	O
quirks	B-General_Concept
mode	I-General_Concept
is	O
triggered	O
:	O
</s>
<s>
Internet	O
Explorer6	O
also	O
uses	O
quirks	B-General_Concept
mode	I-General_Concept
if	O
there	O
is	O
an	O
XML	B-Protocol
declaration	O
prior	O
to	O
the	O
document	O
type	O
declaration	O
.	O
</s>
<s>
Various	O
workarounds	O
have	O
been	O
devised	O
to	O
force	O
Internet	B-Application
Explorer	I-Application
versions	O
5	O
and	O
earlier	O
to	O
display	O
Web	O
pages	O
using	O
the	O
W3C	O
box	O
model	O
.	O
</s>
<s>
These	O
workarounds	O
generally	O
exploit	O
unrelated	O
bugs	O
in	O
Internet	B-Application
Explorer	I-Application
's	O
CSS	B-Language
selector	O
processing	O
in	O
order	O
to	O
hide	O
certain	O
rules	O
from	O
the	O
browser	O
.	O
</s>
<s>
The	O
best	O
known	O
of	O
these	O
workarounds	O
is	O
the	O
"	O
box	O
model	O
hack	O
"	O
developed	O
by	O
Tantek	O
Çelik	O
,	O
a	O
former	O
Microsoft	O
employee	O
who	O
developed	O
this	O
idea	O
while	O
working	O
on	O
Internet	B-Application
Explorer	I-Application
for	O
the	O
Macintosh	O
.	O
</s>
<s>
It	O
involves	O
specifying	O
a	O
width	O
declaration	O
for	O
Internet	B-Application
Explorer	I-Application
for	O
Windows	O
,	O
and	O
then	O
overriding	O
it	O
with	O
another	O
width	O
declaration	O
for	O
CSS-compliant	O
browsers	O
.	O
</s>
<s>
This	O
second	O
declaration	O
is	O
hidden	O
from	O
Internet	B-Application
Explorer	I-Application
for	O
Windows	O
by	O
exploiting	O
other	O
bugs	O
in	O
the	O
way	O
that	O
it	O
parses	O
CSS	B-Language
rules	O
.	O
</s>
<s>
The	O
implementation	O
of	O
these	O
CSS	B-Language
"	O
hacks	O
"	O
has	O
been	O
further	O
complicated	O
by	O
the	O
public	O
release	O
of	O
Internet	O
Explorer7	O
,	O
which	O
has	O
had	O
some	O
issues	O
fixed	O
,	O
but	O
not	O
others	O
,	O
causing	O
undesired	O
results	O
in	O
pages	O
using	O
these	O
hacks	O
.	O
</s>
<s>
Box	O
model	O
hacks	O
have	O
proven	O
unreliable	O
because	O
they	O
rely	O
on	O
bugs	O
in	O
browsers	O
 '	O
CSS	B-Language
support	O
that	O
may	O
be	O
fixed	O
in	O
later	O
versions	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
some	O
Web	O
developers	O
have	O
instead	O
recommended	O
either	O
avoiding	O
specifying	O
both	O
width	O
and	O
padding	O
for	O
the	O
same	O
element	O
or	O
using	O
conditional	B-Application
comment	I-Application
and/or	O
CSS	B-General_Concept
filters	I-General_Concept
to	O
work	O
around	O
the	O
box	O
model	O
bug	O
in	O
older	O
versions	O
of	O
Internet	B-Application
Explorer	I-Application
.	O
</s>
<s>
Web	O
designer	O
Doug	O
Bowman	O
has	O
said	O
that	O
the	O
original	O
Internet	B-Application
Explorer	I-Application
box	O
model	O
represents	O
a	O
better	O
,	O
more	O
logical	O
approach	O
.	O
</s>
<s>
Bernie	O
Zimmermann	O
says	O
that	O
the	O
Internet	B-Application
Explorer	I-Application
box	O
model	O
is	O
closer	O
to	O
the	O
definition	O
of	O
cell	O
dimensions	O
and	O
padding	O
used	O
in	O
the	O
HTML	B-Language
table	O
model	O
.	O
</s>
<s>
When	O
box-sizing	O
:	O
border-box	O
;	O
is	O
specified	O
for	O
an	O
element	O
,	O
any	O
padding	O
or	O
border	O
of	O
the	O
element	O
is	O
drawn	O
inside	O
the	O
specified	O
width	O
and	O
height	O
,	O
"	O
as	O
commonly	O
implemented	O
by	O
legacy	O
HTML	B-Language
user	O
agents	O
"	O
.	O
</s>
<s>
Internet	B-Application
Explorer	I-Application
8	I-Application
,	O
WebKit	B-Language
browsers	O
such	O
as	O
Apple	B-Application
Safari	I-Application
5.1	O
+	O
and	O
Google	B-Application
Chrome	I-Application
,	O
Gecko-based	B-Language
browsers	O
such	O
as	O
Mozilla	B-Application
Firefox	I-Application
29.0	O
and	O
later	O
,	O
Opera	B-Application
7.0	O
and	O
later	O
,	O
and	O
Konqueror	B-Application
3.3.2	O
and	O
later	O
support	O
the	O
CSS3	O
box-sizing	O
property	O
.	O
</s>
<s>
Gecko	B-Language
browsers	O
previous	O
than	O
29.0	O
support	O
the	O
same	O
functionality	O
using	O
the	O
browser-specific	O
-moz-box-sizing	O
property	O
.	O
</s>
<s>
border-box	O
is	O
the	O
default	O
box	O
model	O
used	O
in	O
Bootstrap	B-Application
framework	I-Application
.	O
</s>
