Your First Grid
Lesson 2: Your First Grid
I. Objective: Learn how to place items within a grid and control their size and location.
II. Topics Covered:
Grid Item Placement
Positioning grid items using
grid-columnandgrid-row.
Spanning Rows and Columns
Using
grid-column: span X;andgrid-row: span Y;to make items cover multiple grid cells.
Named Grid Lines
Adding names to grid lines and placing items using
grid-template-areasfor clearer layout code.
III. Activity:
Create a 3x3 grid.
Place items in specific cells using
grid-column-start,grid-column-end,grid-row-start, andgrid-row-end.Experiment with row and column spanning to create a varied layout.
IV. Homework/Practice:
Build a card layout with four cards, where each card spans a different number of columns and rows within the grid.
Last updated