Starting CSS
Let's begin by adding the CSS we utilized in the last lesson. We're shading the grid items in alternating shades of gray and creating a grid container that is repeating the pattern 1fr 2fr twice on each row. Use the CSS code to the left to take care of that.Starting HTML
Next, we will utilize eight boxes (grid items) for our layout. Use the HTML code to the left.Below is what you get in a browser.
NOTE: We'll also add a border and padding to the nested grid items to better see how they are displayed.
Add the nested class to the fourth grid item of the parent grid, thus turning it into a grid container. Then, put three new elements (divs) inside that container.Below is what you get in a browser.
NOTE: Nested grids are soon expected to give way to a new level of the CSS spec called "subgrid." Here's more on this in Rachel Andrew's article called CSS Grid Level 2: Here Comes Subgrid.