O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

column-width

Values:

<length> | auto

Initial value:

auto

Applies to:

Nonreplaced block-level elements (except table elements), table cells, and inline-block elements

Inherited:

No

Computed value:

Absolute length

Description:

Defines the optimal widths of the columns in an element laid out with multiple columns. Note that this describes an optimal width, and as such, user agents may modify or ignore the value if they see fit. The obvious example is if the sum total of the width of the columns and their gaps does not equal the width of the multicolumn element. In such cases, the column widths will be altered to make the columns fit the element. This is somewhat similar in nature to altering the width of table cells so that the table columns fit the table’s total width.

Length values must be greater than zero. For some reason, percentages are not permitted.

Examples:

body {column-width: 23em;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required