A 48rem width query is a viewport condition
@media (min-width: 48rem) { .page { grid-template-columns: 1fr 1fr; } }
@media (width >= 48rem) { .page { grid-template-columns: 1fr 1fr; } }Both queries test the viewport width against 48rem. Neither query names a tablet or a phone.
- The tutorial uses the min-width form on a project grid. This example keeps that threshold so the two pages stay consistent, and adds the equivalent range syntax.
- This is a parse of the condition, not a measured viewport or a device-lab result.
<main class="page">
<article class="card">One</article>
<article class="card">Two</article>
</main>
<style>
.page { display: grid; gap: 1rem; }
.card { border: 1px solid #0B5853; background: #F3EFE4; padding: 0.5rem; font-family: sans-serif; }
@media (min-width: 48rem) {
.page { grid-template-columns: 1fr 1fr; }
}
@media (width >= 48rem) {
.page { column-gap: 1.5rem; }
}
</style>What this markup means
The default rule is a one-column grid. The min-width: 48rem block adds two columns only when the viewport is at least 48rem wide. The second block uses the equivalent range feature (width >= 48rem) to widen the gap; it is the same kind of width test, not a second device profile. Nothing in the stylesheet mentions a phone or tablet, because CSS has no official device-model media type for those names.
Related: CSS tutorial: responsive grid, Grid