.container { width: 600px; height-min: 120px; border: 1px yellow solid; background-color: lightgoldenrodyellow; } .box { width:50px; height:50px; color:red; font-size:36px; background-color:lightskyblue; border: 1pt solid black; }
.container { display:flex; } .box { display:flex; }
.container { display:flex; justify-content: center; }
.container { display:flex; align-items: center; }
.box { display:flex; width:50px; /*height:50px; */ align-items: stretch; }
.container { /* height:600px; */ height:200px; }
.box { min-width:50px; min-height:50px; }
.container { flex-wrap: wrap; }
.container { flex-direction: column; }
center flex-start (top) flex-end (bottom) stretch baseline
<div class="box" style="align-self:flex-start">1</div>
zahl, initial (ursprüngliche Größe)
.box {flex: 1}
<div class="box" style="flex:2">1</div> <div class="box" style="flex:1">2</div> <div class="box" style="flex:initial">3</div> <div class="box" style="flex:1">4</div> <div class="box" style="flex:1">5</div> <div class="box" style="flex:1">6</div>
Aufteilen von items
<div class="box" style="margin-left:auto">3</div>
.container{ flex-direction:column; } .container2 { display: flex; flex-direction:row; } <div class="container"> <div class="container2"> <div class="box">1</div> <div class="box">2</div> <div class="box">3</div> </div> <div class="container2"> <div class="box">4</div> <div class="box">5</div> <div class="box">6</div> </div> </div>