col-span-8: Tailwind CSS Grid class

The col-span-8 class allows an element to span eight columns in a grid layout, typically used to create a larger section.


Interactive Grid Playground

Try each class live and inspect the CSS output.

Utility class
grid grid-cols-3
CSS output
display: grid; grid-template-columns: repeat(3,minmax(0,1fr));

col-span-8

The col-span-8 class allows an element to span eight columns in a grid layout, typically used to create a larger section.

Example Code

HTML
1<div class="rounded-t-md p-4 bg-indigo-50">
2 <div class="grid grid-cols-4 gap-4">
3 <div
4 class="bg-indigo-500 text-white p-4 font-bold text-center col-start-1 col-span-3"
5 >
6 A
7 </div>
8 <div class="bg-indigo-500 text-white p-4 font-bold text-center col-span-3">
9 B
10 </div>
11 <div
12 class="bg-indigo-500 text-white p-4 font-bold text-center col-start-1 col-end-3"
13 >
14 C
15 </div>
16 <div
17 class="bg-indigo-500 text-white p-4 font-bold text-center col-start-4 col-end-6"
18 >
19 D
20 </div>
21 <div
22 class="bg-indigo-500 text-white p-4 font-bold text-center col-start-1 col-span-8"
23 >
24 E
25 </div>
26 </div>
27</div>

Preview

A

B

C

D

E

How to Use

Add the col-span-8 class directly to your HTML element:

HTML
1<div class="col-span-8">
2 <!-- Your content here -->
3</div>

Responsive Usage

Use Tailwind's responsive prefixes to apply col-span-8 at specific breakpoints:

HTML
1<div class="sm:col-span-8 md:col-span-8 lg:col-span-8">
2 Responsive element
3</div>
  • sm:col-span-8 — applies from 640px and up
  • md:col-span-8 — applies from 768px and up
  • lg:col-span-8 — applies from 1024px and up

Customization

You can extend or override this utility in your tailwind.config.js. See the Tailwind CSS documentation for details on customizing your theme.

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates