Lecture_10_CSS Grid Fundamentals & Responsive Design
Lesson 1: CSS Grid Fundamentals
I. Objective: Understand the basic principles of CSS Grid and how it differs from other layout techniques like Flexbox.
II. Topics Covered:
What is CSS Grid?
Introduction to CSS Grid as a 2-dimensional layout system.
Advantages over traditional layout methods.
Defining a Grid Container
display: grid;vs.display: inline-grid;
Grid Lines and Tracks
Columns, rows, and grid lines.
Defining columns and rows using
grid-template-columnsandgrid-template-rows.
The
frUnitIntroduction to the fractional unit and its role in responsive grids.
III. Activity:
Create a simple grid container with three columns and two rows.
Set up
grid-template-columns: 1fr 1fr 1fr;andgrid-template-rows: 100px 200px;.Add items to the grid and observe how they fill the grid cells.
IV. Homework/Practice:
Build a four-column layout using CSS Grid, adjusting column widths with different fractional values (e.g.,
1fr,2fr,3fr,1fr).
Last updated