CSS Grid Playground

CSS Grid Playground

Design two screen configurations. Replace .your-grid with your project selector and check the result with your real content widths.

1. Basic settings

Edit tracks and named areas.

2. Rows and columns by screen

Up to eight tracks per axis. px is fixed, fr shares leftover space, and minmax uses a px minimum and fr maximum.

Wide screen

Columns

1
2

Rows

1
2
3

Narrow screen

Columns

1

Rows

1
2
3
4

3. Named areas

Area names start with a lowercase ASCII letter and may include digits or hyphens. Set starting positions and spans for each screen.

i1 · header

Wide screen
Narrow screen

i2 · aside

Wide screen
Narrow screen

i3 · main

Wide screen
Narrow screen

i4 · footer

Wide screen
Narrow screen

4. Preview and checks

headerHeader
asideAside
mainMain
footerFooter

Preview switches the wide and narrow rules directly. Scroll horizontally to inspect the wide layout on a phone.

5. HTML and CSS

HTML labels are escaped text. Adjust selectors, colors, and spacing for your site.

CSS

.your-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 1fr) minmax(0px, 2fr);
  grid-template-rows: 76px 160px 70px;
  grid-template-areas:
    "header header"
    "aside main"
    "footer footer";
}

.your-grid > .area-header { grid-area: header; }
.your-grid > .area-aside { grid-area: aside; }
.your-grid > .area-main { grid-area: main; }
.your-grid > .area-footer { grid-area: footer; }

@media (max-width: 640px) {
  .your-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 70px 90px 150px 65px;
    grid-template-areas:
      "header"
      "aside"
      "main"
      "footer";
  }
}

HTML

<div class="your-grid">
  <div class="area-header">Header</div>
  <div class="area-aside">Aside</div>
  <div class="area-main">Main</div>
  <div class="area-footer">Footer</div>
</div>

Comments & questions

CSS Grid Playground

Choose fixed px, fractional fr, or minimum-width minmax tracks for each row and column. Place labeled items in named rectangular areas. Edit the wide layout and the narrow layout below your breakpoint separately, then switch the live previews. Overlaps and placements outside the tracks are reported and block export. A valid design produces grid-template-areas, a responsive media query, and matching HTML.

Key features

  • Independent wide and narrow row/column tracks
  • px, fr, and minmax(px,fr) tracks
  • Direct editing of named area placement and spans
  • Overlap and out-of-bounds checks with both previews
  • Copy/download grid-template-areas HTML and CSS

How to use

  1. Start with the example and adjust the breakpoint and gap.
  2. Add or edit row and column tracks for the wide and narrow layouts.
  3. Give each item an area name and its starting row/column and spans in each layout.
  4. Switch previews and resolve overlap or bounds issues.
  5. Copy or download HTML and CSS after validation passes.

Use cases

  • Prototype header, sidebar, content, and footer
  • Compare minmax and fr sizing
  • Review mobile reflow and area conflicts

Frequently asked questions

Can minmax and fr tracks be mixed?

Yes. Each track can be fixed px, fractional fr, or minmax with a px minimum and fr maximum. This editor generates that restricted syntax.

What happens when areas overlap?

If two items use the same cell or an item extends beyond configured tracks, the issue is shown and HTML/CSS exports are disabled.

How is the narrow layout exported?

An @media(max-width) rule below your breakpoint applies the separate narrow rows, columns, and named areas. The preview switches configurations directly.

Can I paste arbitrary CSS?

No. This is a structured editor with a fixed set of grid properties and track bounds. You can extend the downloaded code in another editor.

Is the layout autosaved?

No. It remains in this page's memory. Download HTML and CSS to keep the output.

Privacy

The layout stays in the current browser memory and is not sent to this tool's server API. Downloaded HTML/CSS includes your area names and labels.

Related Tools

CSS Box Shadow GeneratorCSS Gradient GeneratorResponsive Layout AuditorWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorCoordinate Reference LabSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerRaster Reprojection LabElevation Contour MakerTerrain Viewshed LabWatershed DelineatorMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerEmail Template PreviewInternal Link GraphState Machine TesterPetri Net SimulatorGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorStratified Data SplitterData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerGeoJSON Map EditorPolygon Overlay LabCartographic Label PlacerSpatial Table JoinGeoJSON Topology AuditorGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationJSON ↔ YAML ConverterXML ↔ JSON ConverterHTML FormatterJavaScript MinifierMock Data Generator.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorBase64 EncoderJSON FormatterURL EncoderSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterJWT DecoderHTML Entity ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorJSON ↔ CSVCase ConverterImage to Base64
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →