MicrolearnENPTES

Responsive design

Lesson 8 of 20 · Web.Micro

One page, every screen: grids, flexible units and media queries.

A grid that fits as many columns as it can

display: grid with grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) creates as many columns of at least 140px as fit. Drag the page narrower in your mind: on a phone it becomes one column, with no media query at all.

Check yourself

Which unit follows the root font size?

Do it in the browser: a real HTML, CSS and JavaScript tool, a short mission and instant feedback. No install.

Start this lesson — free
← FlexboxVariables and the console →

All lessons · Web.Micro