Propiedad de alineación de contenido CSS
Ejemplo
Líneas de empaque hacia el centro del contenedor flexible:
div
{
width: 70px;
height: 300px;
border: 1px solid #c3c3c3;
display: flex;
flex-wrap: wrap;
align-content: center;
}
Definición y uso
La align-content
propiedad modifica el comportamiento de la
propiedad flex-wrap . Es similar a
align-items , pero en lugar de alinear elementos flexibles, alinea líneas flexibles.
Nota: Debe haber varias líneas de elementos para que esta propiedad tenga algún efecto.
Sugerencia: use la propiedad de justificar el contenido para alinear los elementos en el eje principal (horizontalmente).
Valor por defecto: | tramo |
---|---|
Heredado: | No |
Animable: | No. Leer sobre animable |
Versión: | CSS3 |
Sintaxis de JavaScript: | objeto .style.alignContent="centro" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Los números seguidos de -webkit- especifican la primera versión que funcionó con un prefijo.
Property | |||||
---|---|---|---|---|---|
align-content | 21.0 | 11.0 | 28.0 | 9.0 7.0 -webkit- |
12.1 |
Sintaxis CSS
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
Valores de propiedad
Value | Description | Play it |
---|---|---|
stretch | Default value. Lines stretch to take up the remaining space | |
center | Lines are packed toward the center of the flex container | |
flex-start | Lines are packed toward the start of the flex container | |
flex-end | Lines are packed toward the end of the flex container | |
space-between | Lines are evenly distributed in the flex container | |
space-around | Lines are evenly distributed in the flex container, with half-size spaces on either end | |
space-evenly | Lines are evenly distributed in the flex container, with equal space around them | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
páginas relacionadas
Referencia de CSS: propiedad de elementos de alineación
Referencia CSS: propiedad align-self
Referencia CSS: propiedad de contenido de justificación
Referencia HTML DOM: propiedad alignContent