CSS 的 grid Layout 教學(2) 對齊

使用 justify-content 可以設定水平對齊方向,分別可以設定
start: 對齊開始
end: 對齊結尾
center: 置中
stretch: 展開
space-around: 平均分散
space-between: 從邊緣平均分散
space-evenly: 平均分配,中間的空隙保持相等


可以對個別元素設定 justify-self,可以用的值為 start, end, center 和 stretch


使用 align-content 可以設定區塊內整體的對齊方向,可以使用的值有
start: 對齊開始
end: 對齊結尾
center: 置中
stretch: 展開
space-around: 平均分散
space-between: 從邊緣平均分散
space-evenly: 平均分配,中間的空隙保持相等


可以對個別元素設定 align-self,可以用的值為 start, end, center 和 stretch

留言