column-width

The column-widthCSS property specifies the minimum column width. The number of columns will be the maximum number of columns that can fit without any column having a width less than the column-width value. The actual column width may be smaller than the value of column-width if the width of the container is smaller.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

This allows you to achieve scalable designs that fit different screen sizes. Especially in presence of the column-count CSS property which has precedence, to set an exact column width, all length values must be specified. In horizontal text these are width, column-width, column-gap, and column-rule-width.

The column-width property is specified as one of the values listed below.

Values

<length>

Is a <length> value giving a hint of the optimal width of the column. The actual column width may be wider (to fill the available space), or narrower (only if the available space is smaller than the specified column width). The length must be strictly positive or the declaration is invalid.

auto

The width of the column is determined by other CSS properties, such as column-count.