Instructions
This exersize will work with CSS flexbox and CSS grids. There are similarities between the two. Flexbox has one dimension in either direction, x or y axis, and grid does both x and y axis.
View Rachel Andrew video as she creates a layout, to get an overall idea of how to develop a layout using grids to do a layout from scratch. She copies a BBC page that is more complicated than what you will run into but following her is rewarding. Watch the first 45 minutes.
Setting up the grid.
- Changing the display of an element from block to grid is all it takes to turn the direct children of the element into grid items.
- Target section and turn display to grid, add grid-template-rows at 1fr and give the section padding: 0 10px.
- Assuming that the grid takes up most if not all of the page, it will need to be responsive to gracefully end up with one column for a smartphone and more for larger screens.
- Create a media query that puts the smartphone in the default position and the larger screen in the media query box using @media all and (min-width: 600px) {}
- Set up the page for viewing on smartphones.