HTML and CSS Reference

In-Depth Information

b. If
top
and
bottom
are
auto
and
height
is not, set
top
to the static position. Reset

any
auto
values for
margin-top
and
margin-bottom
to
0
and solve the equation for

bottom
.

c. If
height
and
bottom
are
auto
and
top
is not, the height is based on the element's

content (as it would be in the static flow). Reset any
auto
values for
margin-top
and

margin-bottom
to
0
and solve the equation for
bottom
.

d. If
top
is
auto
and
height
and
bottom
are not, reset any
auto
values for
margin-top

and
margin-bottom
to
0
and solve the equation for
top
.

e. If
height
is
auto
and
top
and
bottom
are not, reset any
auto
values for
margin-top

and
margin-bottom
to
0
and solve the equation for
height
.

f. If
bottom
is
auto
and
top
and
height
are not, reset any
auto
values for
margin-top

and
margin-bottom
to
0
and solve the equation for
bottom
.

For replacedelements, the steps used to determine vertical layout are:

2. If both
top
and
bottom
are set to
auto
, set
top
to the static top position.

3. If the values are overconstrained, ignore the value for
bottom
and solve for that value.