flex佈局爲彈性佈局:
根據x軸和y軸來定位,flex佈局的flex-direction屬性、justify-content屬性和align-items屬性。
父標籤設置display:flex;flex-direction: row;沿着x軸排列
效果如下:
父標籤設置display:flex;flex-direction: column;沿着y軸排列
效果圖如下:
justify-content:flex-start;justify-content: center; justify-content:flex-end;
效果圖:
justify-content: space-between; justify-content: space-around;
效果圖:
align-items: flex-start; align-items: center; align-items: flex-end;
效果圖: