Proprietà CSS align-content
Esempio
Imballare le linee verso il centro del contenitore flessibile:
div
{
width: 70px;
height: 300px;
border: 1px solid #c3c3c3;
display: flex;
flex-wrap: wrap;
align-content: center;
}
Definizione e utilizzo
La align-content
proprietà modifica il comportamento della
proprietà flex-wrap . È simile a
align-items , ma invece di allineare elementi flessibili, allinea le linee flessibili.
Nota: perché questa proprietà abbia effetto, devono essere presenti più righe di elementi!
Suggerimento: utilizza la proprietà justify-content per allineare gli elementi sull'asse principale (orizzontale).
Valore di default: | stirata |
---|---|
Ereditato: | no |
Animabile: | no. Leggi su animabile |
Versione: | CSS3 |
sintassi JavaScript: | oggetto .style.alignContent="centro" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
I numeri seguiti da -webkit- specificano la prima versione che ha funzionato con un prefisso.
Property | |||||
---|---|---|---|---|---|
align-content | 21.0 | 11.0 | 28.0 | 9.0 7.0 -webkit- |
12.1 |
Sintassi CSS
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
Valori di proprietà
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 |
Pagine correlate
Riferimento CSS: proprietà align-items
Riferimento CSS: proprietà align-self
Riferimento CSS: proprietà justify-content
Riferimento HTML DOM: proprietà alignContent