レイアウト
flex-box
配置「justify-content」
- center:中央に寄せ
- space-around:等間隔
- space-between:最初と最後は端、他は等間隔
行「flex-wrap」
- wrap:余分が次行に回る
- nowrap:親要素の幅に収まるように縮小
配置方法「align-items」
- center:高さに対して中央に表示
- stretch:高さいっぱい
float 横並び
- left:左寄せ
- right:右寄せ
clearfix:float解除
floatは親要素の高さをなくす為、解除「clear: both」が必要
html
<div class="clearfix"> <p class="float">BOX1</p> <p class="float">BOX2</p> <p class="float">BOX3</p> </div>
.float { float: left; } .clearfix::after { content: ""; display: block; clear: both; }