CSS: The Definitive Guide, 3rd Edition (73 page)

Read CSS: The Definitive Guide, 3rd Edition Online

Authors: Eric A. Meyer

Tags: #COMPUTERS / Web / Page Design

BOOK: CSS: The Definitive Guide, 3rd Edition
9.49Mb size Format: txt, pdf, ePub
vertical-align

This defines the vertical alignment of an inline element's baseline with respect
to the baseline of the line in which it resides. Negative length and percentage
values are permitted, and they lower the element instead of raising it. In table
cells, this property sets the alignment of the content of the cell within the cell
box.

Values:

baseline
|
sub
|
super
|
top
|
text-top
|
middle
|
bottom
|
text-bottom
| | |
inherit

Initial value:

baseline

Applies to:

Inline elements and table cells

Inherited:

No

Percentages:

Refer to the value of
line-height
for
the element

Computed value:

For percentage and length values, the absolute length; otherwise, as
specified

Note:

When applied to table cells, only the values
baseline
,
top
,
middle
, and
bottom
are recognized

visibility

This specifies whether
the element box generated by an element is rendered. This means the element could
occupy the space it would ordinarily, but be completely invisible. The value
collapse
is used in tables to remove columns or rows
from the table's layout.

Values:

visible
|
hidden
|
collapse
|
inherit

Initial value:

inherit

Applies to:

All elements

Inherited:

No

Computed value:

As specified

white-space

This declares how whitespace within an element is handled during layout. The
values
pre-wrap
and
pre-line
were added in CSS2.1.

Values:

normal
|
nowrap
|
pre
|
pre-wrap
|
pre-line
|
inherit

Initial value:

normal

Applies to:

All elements (CSS2.1); block-level elements (CSS1 and CSS2)

Inherited:

No

Computed value:

As specified

width

This defines the width of
an element's content area, outside of which padding,
borders, and margins are added. This property is ignored for inline nonreplaced
elements. Negative length and percentage values are not permitted.

Values:

| |
auto
|
inherit

Initial value:

auto

Applies to:

Block-level and replaced elements

Inherited:

No

Percentages:

Refer to the width of the containing block

Computed value:

For
auto
and percentage values, as
specified; otherwise, an absolute length, unless the property does not apply
to the element (then
auto
)

word-spacing

This defines the amount
of whitespace to be inserted between words in an element. For the purposes of this
property, a "word" is defined as a string of characters surrounded by whitespace.
Length values create a modifier to the usual spacing between words; thus,
normal
is synonymous with
0
. Negative length values are permitted and will cause words to bunch
closer together.

Values:

|
normal
|
inherit

Initial value:

normal

Applies to:

All elements

Inherited:

Yes

Computed value:

For
normal
, the absolute length
0
; otherwise, the absolute
length

z-index

This property sets the placement of a positioned element along the
z
-axis, which is defined as the axis that extends perpendicular
to the display area. Positive numbers are closer to the user, and negative numbers
are further away.

Values:

|
auto
|
inherit

Initial value:

auto

Applies to:

Positioned elements

Inherited:

No

Computed value:

As specified

Tables
border-collapse

This property defines the layout model used in laying out the borders in a
table—i.e., those applied to cells, rows, and so forth. Although the property applies
only to tables,
it is inherited by all the elements
within the table.

Values:

collapse
|
separate
|
inherit

Initial value:

separate

Applies to:

Elements with the
display
value
table
or
inline-table

Inherited:

Yes

Computed value:

As specified

Note:

In CSS2, the default value was
collapse

border-spacing

This specifies the
distance between cell borders in the separated borders model. The first of the two
length values is the horizontal separation, and the second is the vertical. This
property is ignored unless
border-collapse
is set
to
separate
. Although the property only applies to
tables, it is inherited by all of the elements within the table.

Values:

? |
inherit

Initial value:

0

Applies to:

Elements with the
display
value
table
or
inline-table

Inherited:

Yes

Computed value:

Two absolute lengths

Note:

This property is ignored unless
border-collapse
value is
separate

caption-side

This specifies the placement of
a table caption with respect to the table box. The
caption is rendered as though it were a block-level element placed just before (or
after) the table.

Values:

top
|
bottom

Initial value:

top

Applies to:

Elements with the
display
value
table-caption

Inherited:

Yes

Computed value:

As specified

Note:

The values
left
and
right
appeared in CSS2 but were dropped from
CSS2.1 due to a lack of widespread support

empty-cells

This defines
the presentation of table cells that contain no content. If shown, the cell's borders
and background are drawn. This property is ignored unless
border-collapse
is set to
separate
.

Values:

show
|
hide
|
inherit

Initial value:

show

Applies to:

Elements with the
display
value
table-cell

Inherited:

Yes

Computed value:

As specified

Note:

This property is ignored unless
border-collapse
value is
separate

table-layout

This property specifies which
layout algorithm is used to lay out a table. The fixed layout algorithm is faster but
less flexible, while the automatic algorithm is slower but more reflective of
traditional HTML tables.

Values:

auto
|
fixed
|
inherit

Initial value:

auto

Applies to:

Elements with the
display
value
table
or
inline-table

Inherited:

Yes

Computed value:

As specified

Paged Media
orphans

This specifies the minimum number of text lines within the element that can be
left at the bottom of a page. This can affect the placement of page breaks
within
the element.

Values:

|
inherit

Initial value:

2

Applies to:

Block-level elements

Inherited:

Yes

Computed value:

As specified

page-break-after

This declares whether page breaks should be placed after an element. While it is
possible to force breaks with
always
, it is not
possible to guarantee prevention; the best an author can do is ask the user agent to
avoid
inserting a page break if possible.

Values:

auto
|
always
|
avoid
|
left
|
right
|
inherit

Initial value:

auto

Applies to:

Nonfloated block-level elements with a
position
value of
relative
or
static

Inherited:

No

Computed value:

As specified

page-break-before

Declares whether page
breaks
should
be placed before an element. While it is possible to force breaks with
always
, it is not possible to guarantee prevention; the
best an author can do is ask the user agent to
avoid
inserting a page break if possible.

Values:

auto
|
always
|
avoid
|
left
|
right
|
inherit

Initial value:

auto

Applies to:

Nonfloated block-level elements with a
position
value of
relative
or
static

Inherited:

No

Computed value:

As specified

page-break-inside

This declares whether page breaks should be placed inside an element. Because an
element might be taller than a page box, it is not possible to guarantee prevention;
the best an author can do is ask the user agent to
avoid
inserting a page break if possible.

Values:

auto
|
avoid
|
inherit

Initial value:

auto

Applies to:

Nonfloated block-level elements with a
position
value of
relative
or
static

Inherited:

Yes

Computed value:

As specified

widows

This specifies the minimum number of text lines within the element that can be
left at the top of a page. This can affect the placement of page breaks within the
element.

Values:

|
inherit

Initial value:

2

Applies to:

Block-level elements

Inherited:

Yes

Computed value:

As specified

Other books

A Year Less a Day by James Hawkins
The 13th Tablet by Alex Mitchell
Tall, Dark and Cowboy by Joanne Kennedy
Next Year in Israel by Sarah Bridgeton
Sugar And Spice by Fluke, Joanne
That Way Lies Camelot by Janny Wurts
Given by Ashlynn Monroe