2. About me
Name: Matan Yossef
Age: 25
Position:
- Front End Developer at Incuber (Start-Up)
Education:
- Front End Development course at Netcraft Academy
- B.A in Business Management & New Media
3. We have so many display
techniques already
why should I bother with
display:grid
4. The trouble with current CSS layout
● Floats and clearfix hacks
● Absolute positioning means elements are taken out of the
document flow and risk overlaps
● Unnecessary markup and positioning oddities with display:table
● White space issues with inline-block
● Flexbox has only one-dimensional layouts
8. No margin nor padding
USE GRID GAP !
.container {
display: grid;
grid-row-gap: 20px;
grid-column-gap: 20px;
/* shorthand*/
grid-gap: 20px 20px;
/* super shorthand*/
grid-gap: 20px;
}
https://codepen.io/matanyo
/pen/YZjVVq
9. New CSS unit
The fr unit
fr = “fraction of space”
grid-template-columns: 25% 25% 25% 25%;
/* 1fr 1fr 1fr 1fr */
Back to my codepen https://codepen.io/matanyo/pen/YZjVVq
Mixed with fixed size