/css-grid-and-flexbox-demo

Demo of the new(ish) CSS Grid spec as compared to Flexbox

Primary LanguageCSS

CSS Grid Layout Demo

by Martin Laws, Front End @ Ample Organics


What's the difference between Flexbox and CSS Grid?

Flexbox is one-dimensional. Each row becomes its own flex-container, meaning that members of a row only know about their direct siblings, they are not aware of members of other flex-containers. This is not a problem when the layout is one-dimensional (e.g. top -> bottom, left -> right), but becomes highly problematic when you want vertical and horizontal layout control. Flexbox Layout Example

Grid allows you to declare two-dimensional layouts, much in the same way as third-party grids (Bootstrap, Foundation, Skeleton, etc.), but is native to CSS. Grid Layout Example

Links and Reference Material