HTML and CSS Reference
In-Depth Information
The width of any vertical scrollbar is determined by the user agent and cannot be affected with
CSS.
For nonreplacedelements, the steps used to determine horizontal layout are:
1. If all of
left
,
width
, and
right
are
auto
, first reset any
auto
values for
margin-left
and
margin-right
to
0
. Then, if
direction
is
ltr
, set
left
to the static position and ap-
ply the rule given in step 3c. Otherwise, set
right
to the static position and apply the rule
given in step 3a.
2. If none of
left
,
width
, and
right
is
auto
, pick the rule that applies from the following
list:
a. If both
margin-left
and
margin-right
are set to
auto
, solve the equation under the
additional constraint that the two margins get equal values.
b. If only one of
margin-left
or
margin-right
is set to
auto
, solve the equation for
that value.
c. If the values are overconstrained (none is set to
auto
), ignore the value for
left
if
direction
is
rtl
(ignore
right
if
direction
is
ltr
) and solve for that value.
3. If some of
left
,
width
, and
right
are
auto
, but others are not, reset any
auto
values
for
margin-left
and
margin-right
to
0
. From the following list, pick the one rule that
applies:
a. If
left
and
width
are
auto
and
right
is not, the width is shrink-to-fit. Solve the
equation for
left
.
b. If
left
and
right
are
auto
and
width
is not, then if
direction
is
ltr
, set
left
to
the static position (otherwise, set
right
to the static position). Solve the equation for
left
(if direction is
rtl
) or
right
(if
direction
is
ltr
).
c. If
width
and
right
are
auto
and
left
is not, the width is shrink-to-fit. Solve the
equation for
right
.
d. If
left
is
auto
and
width
and
right
are not, solve the equation for
left
.
e. If
width
is
auto
and
left
and
right
are not, solve the equation for
width
.
f. If
right
is
auto
and
left
and
width
are not, solve the equation for
right
.
For replacedelements, the steps used to determine horizontal layout are: