Propriedade CSS align-content
Exemplo
Embale as linhas em direção ao centro do contêiner flexível:
div
{
width: 70px;
height: 300px;
border: 1px solid #c3c3c3;
display: flex;
flex-wrap: wrap;
align-content: center;
}
Definição e uso
A align-content
propriedade modifica o comportamento da
propriedade flex-wrap . É semelhante a
align-items , mas em vez de alinhar itens flexíveis, ele alinha linhas flexíveis.
Nota: Deve haver várias linhas de itens para que esta propriedade tenha algum efeito!
Dica: Use a propriedade justify-content para alinhar os itens no eixo principal (horizontal).
Valor padrão: | alongamento |
---|---|
Herdado: | não |
Animavel: | não. Leia sobre animáveis |
Versão: | CSS3 |
Sintaxe JavaScript: | objeto .style.alignContent="center" |
Suporte ao navegador
Os números na tabela especificam a primeira versão do navegador que oferece suporte total à propriedade.
Números seguidos por -webkit- especificam a primeira versão que funcionou com um prefixo.
Property | |||||
---|---|---|---|---|---|
align-content | 21.0 | 11.0 | 28.0 | 9.0 7.0 -webkit- |
12.1 |
Sintaxe CSS
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
Valores de propriedade
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
Referência CSS: propriedade align-items
Referência CSS: propriedade align-self
Referência CSS: propriedade justify-content
Referência HTML DOM: propriedade alignContent