systematic = qnnect, empanizado, enginerring, 0120519030, openrent, destresser, котор, ζουκοφ, censa, 7623564661, chaura, tuzexovky, tecnosystemi, neurosphere, misipasta, 3519946774, espartillar, мартинез, 7193657382, nationalitate, семаргл, centralistas, turfpmu, fabspeed, nacobre, repan, 6314823824, celanext, 0120983888, sarao, 4649072, 1530000, 470001, kenkäpenkki, иисус, хелоуин, simplifinancial, topcinma, amazonj, лисенківщина, krampfader, phantasmal, адвент, كلوزابين, كوليروزبلس, filezen, макушилд, pribory, включить, virtualgf, glukoz, ayhoo, pedagogos, vialink, 0570033910, 18448302149, 065300279, eumed, фісташка, 30693834348, прийнято, 18552428282, ladis, kraftverket, zrelki, 4662180, jadennewman, crispycards, 0120993190, trodis, necesitaba, 0367436153, 0364324122, ascalon, sportsbike, дентисепт, бешамель, χαριτσης, 08001231249, paquidermo, piskote, riming, pfadfinder, úlceras, teneryfa, teploměr, aryzaltec, zwangsurlaub, paternosterregal, krumplipure, 7043876515, ستيروجيل, solunac, ортодокс, kahfi, jollislut, 08000778057, ترجمو, webbroker, 77436001, tuvilaso, مشرقي, 05054973287, hanaso, cochetica, realicen, wildbeast, etabli, 05031217904, ευρυτανία, novinar, boina, taniumcx, entree, piparkakkumuotti, bestbyy, directrices, 18667478132, 0526887340, exteragram, 1300305884, scotiabank, 8665320424, heliocampus, plansa, 9093167395, cultivar, grossolano, theblowers, panaro, sebagai, pyykkikorit, бензобур, diwataplay, rkill, sicma, skepparmössa, τζιγκερ, daquiri, magcombo, sunsey, 3379481751, 5136961920, microleap, كوتشات, lukutaito, meganthekim, zarzare, kazbah, artisanat, condensadores, balagtasan, prunelax, korido, darthub, ojetillos, гдамалер, vhandicap, 08020591168, 8012367591, hidruros, fortitude, mscpt, 70703147, 3271637819, 3299894064, sextot, 8002752273, pepena, marsaalam, ホスラブ, frammenti, proplifting, fruttivendolo, 3061625, tktybe, gomones, اكصدام, onceavo, deeleconomie, 0120868411, zoofilico, кандибіотик, irregularly, szüretelőkád, tutorialspoint, tapsilog, 3780000, rotiserias, skylarking, yujiro, soroptomist, 4517900, käppi, vaxxas, diamantul, дилер, usapa, pablin, dougnuts, 0277519126, possibilità, 08020590938, raduljica, 3807747232, 0120100472, tapilok, 0120012367, نافورة, ytitty, barmera, kalentong, 3043173679, bodins, 2147483647, leifers, фесто, 0911341839, бушмилс, huyendo, самолети, kalsiumkloridi, visperas, артеджа, usureros, floripondia, ليريكا, 031309123, 0980453184, yamama, cinci, estofado, 5416448102, usmay, desmosomy, ntdof, 3510316175, 3806919826, 5090000, ντάκος, remeta, bilaz, солитёр, verhokoukku, inprotur, хлебомор, 0594242, каміння, ناسيتا, tapado, 0675264631, spirion, trassbeton, winmau, caligrafías, 05054974028, rentnerhandy, sulfacetamida, мадмуазель, 4627449, almaviva, atoskin, stausee, 9517816335, 0120751141, architextures, сперматозоїди, lyricist, masseurfinder, dapsa, queilosis, hondae, swicht, verixzon, sajentologija, sensorial, pinqyum, dolcino, 3513321678, салінблоки, σευχελες, coágulos, retiniert, scjentyzm, timberleaf, calathéa, pinaypei, furlow, poxclin, slovacchia, armadillomon, 08002227288, ounce, stercoraro, debroah, quickplay, 8055072161, exfoliar, dacryostenosis, runwa, imparticular, 7791293012087, 0649676660, vrouw, giacaphe, 7702855074, małszewo, batchoy, kirchbach, fagocitoza, filatil, fluoksetyna, crashdocs, konferencier, рапсодія, amatek, metadiemil, gaudí, piest, temblor, назарян, ashandbunny, электробритва, frantics, шарлан, 607250635, 0359571773, finguru, tentative, szyfrowanie, мофлакса, bergpfad, märchenstraße, snören, 08002223094, promepal, pokróc, sagaji, zdravac, борат, impedancja, lizing, boxeringweb, vitklöver, cecomed, litigated, reprocann, muldova, sigas, eleanor, karlovci, organicos, mathalino, циклопирокс, 0345418401, ticketalarm, 5183999126, freemova, maviri, індивід, endontics, vejska, florifundio, malmoe, kutchenhaus, softbol, destinus, desarrolladores, 05030323126, kultainen, гросдорф, ipool, faserlaser, kyjak, hatchet, diakhiteldirekt, 39978123213, araira, джеймсон, cheezee, прости, lymphom, 08008889410, sporx, 07026557424, foodgod, zusduri, migii, jumpinto, граніт, نيتشه, reifenhändler, fapellop, 08001232218, savaco, legényrózsa, addbike, euroescord, сурфінія, foxneqs, bezoary, insycle, здраво, transferee, pilaki, snapcam, 05050500682, trecevision, 7868512930, baroen, nynomic, مرسيليا, gauchitos, 8008442881, feuerpferd, nebelradar, koolraap, allerzone, wondergoo, seruling, 0277436016, ardid, dirak, marohome, eisrezepte, fußzeh, fondeo, mobble, 3916427650737558089, bobimx, baritastic, 4808272, 0222117259, atemschutzmasken, rozdrabniacz, tdautofiance, bangsar, galvanizada, guaren, veresova, favostix, flatform, 6076999031, sjöviksskolan, recafi, hypeauditor, vogtlandradio, asteres, тимчик, smudj, 0183881001, ocotepec, voxtelesys, 3801595906, 150001, 05031251558, 4797754, mielenterveystalo, 09090114995, 3314533648, visión, 0120426807, sweatybetty, analizando, 0120125177, falletti, sinea, βοριζια, 07026558985

Feature

grid system web design — Page Layout

grid system web design

Your layout keeps drifting out of alignment, and fixing it piece by piece is tiring. A grid system web design approach solves it: define columns, rows and gutters once, then line everything up with CSS grid.

This page is part of the wider guide to web page layout.

Item Value
Grid type Two-dimensional: rows and columns together
Result of display: grid on its own A one column grid
Flexible track unit fr, a fraction of the available space
Gutters The gaps between rows and columns
Column lines in a four-column grid Five column lines

These figures come from MDN’s CSS grid layout lesson and web.dev’s Learn CSS grid chapter. Specifications and browser behaviour can change, so check the sources before you rely on them.

What a grid system is in web design

A grid is a collection of horizontal and vertical lines that gives every element on the page something to line up against. According to MDN’s Learn course, that keeps elements from jumping around or changing width as visitors move from page to page, which gives your site greater consistency.

A grid typically has columns, rows and gaps between them, and the gaps are commonly called gutters. Everything else in this guide is a variation on those three parts.

Designers once reached for floats, tables and frameworks to build this structure. In its 2017 introduction, Mozilla Hacks pointed out that CSS Grid Layout is a two-dimensional grid system native to CSS. As of that October 2017 post, it was described as a web standard that works in all modern browsers.

The parts of a grid: lines, tracks, cells, areas and gutters

Learn the vocabulary first and the CSS reads like plain English. The terms below follow web.dev’s grid chapter and MDN’s basic concepts guide.

  • Grid lines run horizontally and vertically. If your grid has four columns, it has five column lines, including the one after the last column.
  • Grid tracks are the space between any two adjacent lines, so a column track sits between two column lines.
  • Grid cells are the smallest space on a grid, defined where a row track and a column track intersect.
  • Grid areas are created when an item spans over multiple tracks.
  • Gutters are the gaps between tracks. You can’t place content into a gap, but you can span grid items across it.

Most browsers can overlay these lines on a live page through their developer tools, which makes the terms much easier to picture.

How to build a grid system with CSS

You need very little code to turn the theory into a working layout. Follow these steps, based on MDN’s basic concepts guide.

  1. Create the container by declaring display: grid or display: inline-grid on an element. All direct children of that element become grid items.
  2. Expect no visible change at first, because a container with only display: grid gives you a one column grid.
  3. Add column tracks with the grid-template-columns property. You can use any length unit or percentage to size them.
  4. Add a gap so the gutters between rows and columns are equal.
  5. Place items by line number, by name, or by targeting an area of the grid. Items you leave alone are placed automatically.

Mozilla’s tutorial notes that one gap declaration gives you an equal-sized gutter between all rows and columns. If you place an item outside the tracks you defined, the browser builds extra tracks in the implicit grid.

Wooden blocks spelling web design on a grid background symbolizing creative digital design concepts.

Sizing tracks: fixed, fluid or mixed

The fr unit is the heart of a flexible grid. As MDN’s lesson explains, it represents one fraction of the available space in the grid container, so columns grow and shrink with the page.

There is one catch. The fr unit shares out available space, not all space, so a track holding something large leaves less free space for its neighbours.

You can mix sizing methods in one grid, and you have three main options:

  • Fixed lengths, such as pixels or ems, for a sidebar that must not move.
  • Percentages or fr units for tracks that should flex with the container.
  • Intrinsic keywords such as min-content, max-content and fit-content(), which size a track from its content.

The min-content keyword makes a track as small as it can be without its content overflowing, according to web.dev. If you keep typing the same length, Mozilla suggests the repeat() notation as a shortcut.

Do you need a 12-column grid?

Not always. MDN’s guide to CSS grid layout lists a 12-column flexible grid system among its example layouts, but it is one pattern, not a rule.

Let your content choose the number of columns. A simple article page may need only one wide column and a narrow sidebar, while a product listing may need many small cells.

Sketching the structure first saves rework, and a website wireframe is the cheapest place to test column counts. Column widths also set your line length, so it helps to read about typography in web design before you fix them.

Where grid helps and where it can hurt

Grid suits page-level structure. web.dev says a really common layout in web design is a header, sidebar, body and footer arrangement, and grid handles it in a few lines.

For smaller parts, pair it with other tools. MDN notes that grid combined with flexbox can help you create layouts that are responsive, flexible and accessible.

Placement freedom has a cost. MDN has a guide on grid layout and accessibility that looks at how grid can both help and harm, so read it before you move items away from their order in the HTML.

Frequently asked questions

Is CSS grid the same thing as a grid system?

Show answer

No. The grid system is your design decision about columns, rows and gutters, while CSS grid is one tool for building it. You can plan the system in a sketch and implement it with other methods if you must.

Should I choose grid or flexbox?

Show answer

Use both. Let grid control the rows and columns of the page, and let flexbox arrange the items inside a single card or toolbar.

Why do my items still stack after I add display: grid?

Show answer

That is the starting state: grid begins with a single column track. Define more tracks with grid-template-columns and the items will spread across cells, as described in MDN’s lesson.

What happens to items outside the grid I defined?

Show answer

The browser adds tracks for them. MDN says tracks are created in the implicit grid when an item is positioned beyond the tracks of the explicit grid.