Menu
CoddyTech

Column Spans

Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 27 of 55.

Within a grid, col-span-2 lets one item occupy two column tracks. Put the span on the child; the parent still defines the total number of columns.

<div class="grid grid-cols-4">
  <div class="col-span-1">Museum sample</div>
</div>

A span can move later items onto another row when there is not enough room remaining. col-span-full uses the first and last explicit grid lines, so it stretches across the grid even when its column count changes. A numeric suffix can request another count, such as col-span-3 for three tracks.

challenge icon

Challenge

Medium

Make the exhibit summary span three columns in the supplied four-column grid.

Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.

Try it yourself

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="parent_target" class="grid grid-cols-4 w-80"><div id="target" class="">Exhibit summary</div><span>Map</span></div>
</body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals