Propiedad CSS column-count
La propiedad column-count especifica el número de columnas en las que se dividirá el contenido de un elemento.
La propiedad column-count es una de las propiedades CSS3.
Acepta un valor numérico o la palabra clave auto. auto es el valor predeterminado. Cuando se establece en auto, el número de columnas se determina mediante otras propiedades como column-width. Un valor numérico especifica el número exacto de columnas en las que se debe distribuir el contenido del elemento.
| Valor inicial | auto |
|---|---|
| Se aplica a | Contenedores de bloque, excepto cajas contenedoras de tablas. |
| Heredable | No. |
| Animable | Sí. El número de columnas es animable. |
| Versión | CSS3 |
| Sintaxis DOM | object.style.columnCount = "4"; |
Sintaxis
Sintaxis de la propiedad column-count
css
column-count: <integer> | auto | initial | inherit;Ejemplo de la propiedad column-count:
Ejemplo de la propiedad CSS column-count con valor auto
html
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
div {
column-count: auto;
}
</style>
</head>
<body>
<h2>Column-count property example</h2>
<div>
Lorem Ipsum is dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</body>
</html>Resultado

Ejemplo de la propiedad column-count con un valor numérico:
Ejemplo de la propiedad CSS column-count con un valor numérico
html
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
div {
column-count: 7;
}
</style>
</head>
<body>
<h2>Column-count property example</h2>
<div>
Lorem Ipsum is dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It is a great fact that a reader will be distracted by the readable content of a page when looking at its layout.
</div>
</body>
</html>Valores
| Valor | Descripción | Probar |
|---|---|---|
| auto | El número de columnas lo determinan otras propiedades. Este es el valor predeterminado de esta propiedad. | Probar » |
<integer> | Especifica el número exacto de columnas en las que se debe distribuir el contenido. | Probar » |
| initial | Establece la propiedad en su valor predeterminado. | Probar » |
| inherit | Hereda la propiedad de su elemento padre. |
Práctica
¿Qué hace la propiedad CSS 'column-count'?