CHAPTER 73

CSS Grid Items

Learn how individual grid items can span rows and columns.

01. What is CSS Grid Items?

Grid items can occupy one or more columns or rows.
grid-column controls column placement.
grid-row controls row placement.

02. Syntax

.item { grid-column: 1 / 3; grid-row: 1 / 2; }

03. Example

CSS / HTML Example AIFA Coding Lab
<!DOCTYPE html>
<html>
<head>
<style>

.grid {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 15px;
}

.item {
    padding: 25px;
    background: #dbeafe;
}

.feature {
    grid-column: 1 / 3;
}

</style>
</head>
<body>

<div class="grid">

    <div class="item feature">
        Featured Course
    </div>

    <div class="item">HTML</div>

    <div class="item">CSS</div>

</div>

</body>
</html>

04. Important Points

✓ grid-column controls column placement.
✓ grid-row controls row placement.
✓ span can specify how many tracks an item should occupy.
✓ Grid items can create featured layouts.

05. Common Mistakes

⚠ Using incorrect grid line numbers.
⚠ Creating overlapping items accidentally.
⚠ Ignoring responsive behavior.

06. Real World Use

Grid item placement is useful for dashboards, magazine layouts, featured cards and portfolio designs.

Ready to Practice? 🚀

Open the AIFA CSS Editor and practice this chapter live.

Try It Yourself →
Practice Exercise

Create a Featured Card

Create a three-column grid where the first card spans two columns.