display: flex;
flex-direction:row;
}
display: flex;
flex-direction: row-reverse;
}
display: flex;
flex-direction: column;
}
display: flex;
flex-direction: column-reverse;
}
Codice
<div class="row">
<div class="col-xl-auto">
<div class="contenitore" style="display: flex; flex-direction:row;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display: flex; flex-direction:row-reverse;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display: flex; flex-direction:column;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display: flex; flex-direction:column-reverse;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
</div>
display: flex;
flex-wrap: nowrap;
}
display: flex;
flex-wrap: wrap;
}
display: flex;
flex-wrap: wrap-reverse;
}
Codice
<div class="row">
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; flex-wrap:nowrap; width:auto;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display: flex; flex-wrap: wrap;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display: flex; flex-wrap: wrap-reverse;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
</div>
flex-direction: row;
display: flex;
justify-content: flex-start
}
display: flex;
justify-content: flex-end
}
display: flex;
justify-content: center
}
display: flex;
justify-content: space-between
}
display: flex;
justify-content: space-around
}
flex-direction: column;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
display: flex;
flex-direction: column;
justify-content: flex-end;
}
display: flex;
flex-direction: column;
justify-content: center;
}
display: flex;
flex-direction: column;
justify-content: space-between;
}
display: flex;
flex-direction: column;
justify-content: space-around;
}
Codice
<div class="row">
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; justify-content:flex-start;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; justify-content:flex-end;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; justify-content:center;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; justify-content:space-between;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; justify-content:space-around;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; flex-direction: column; justify-content:flex-start;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; flex-direction: column; justify-content:flex-end;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; flex-direction: column; justify-content:center;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; flex-direction: column; justify-content:space-between;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; flex-direction: column; justify-content:space-around;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
</div>
stretch
allunga gli elementi per coprire l'intera altezza del contenitore, eliminando lo spazio residuo.baseline
allinea gli elementi seguendo la linea di base del testo in essi contenuto. Come si può osservare nell'esempio, il testo dei tre elementi ha dimensione differente. L'elemento con il testo di dimensioni maggiori viene posizionato all'inizio dell'asse e gli altri elementi vi si allineano seguendo la base del testo.display: flex;
align-items: flex-start;
}
display: flex;
align-items: flex-end;
}
display: flex;
align-items: center;
}
display: flex;
align-items: stretch;
}
display: flex;
align-items: baseline;
}
Codice
<div class="row">
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-items:flex-start;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-items:flex-end;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-items:center;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-items:stretch;">
<div class="box1" style="min-height: 2.5rem;height: auto;">1</div>
<div class="box2" style="min-height: 2.5rem;height: auto;">2</div>
<div class="box3" style="min-height: 2.5rem;height: auto;">3</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-items:baseline;">
<div class="box1">1</div>
<div class="box2" style="font-size: 120%;">2</div>
<div class="box3" style="font-size: 150%;">3</div>
</div>
</div>
</div>
justify-content
, ma si applica all'asse verticale.
e ha bisogno del flex-wrap:wrap;
per scorrere su più righe.display: flex;
flex-wrap: wrap;
align-content: flex-start;
}
display: flex;
flex-wrap: wrap;
align-content: flex-end;
}
display: flex;
flex-wrap: wrap;
align-content: center;
}
display: flex;
flex-wrap: wrap;
align-content: space-between;
}
display: flex;
flex-wrap: wrap;
align-content: space-around;
}
Codice
<div class="row">
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-content:flex-start; flex-wrap:wrap;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-content:flex-end; flex-wrap:wrap;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-content:center; flex-wrap:wrap;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-content:space-between; flex-wrap:wrap;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
<div class="col-xl-auto">
<div class="contenitore" style="display:flex; align-content:space-around; flex-wrap:wrap;">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
<div class="box4">4</div>
<div class="box5">5</div>
<div class="box6">6</div>
<div class="box7">7</div>
<div class="box8">8</div>
</div>
</div>
</div>