高级前端
css
【Q506】Grid 布局如何实现类似 flex: row-reverse

Grid 布局如何实现类似 flex: row-reverse

Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 518 (opens in a new tab)

Author 回答者: CsongL (opens in a new tab)

通过 grid-auto-flow属性 和 direction属性 来实现grid布局类似 flex: row-reverse的样式

grid-auto-flow: [row | column] || dense 该属性指定采用grid布局的容器内部的元素如何排序 direction: rtl | ltr 指定文本, 表列的水平方向

Code (opens in a new tab)

Reference

MDN (opens in a new tab) Article (opens in a new tab)