Skip to content

Responsive Design

In one line

Responsive design is an approach where a website's layout and content adapt to the screen size of the device viewing it.

In simple words

Responsive design means building websites that look good and work well on all devices — from small phones to large desktop monitors. Instead of creating separate sites for mobile and desktop, you build one site that adapts.

The three core ingredients are: fluid grids (using relative units like % and fr instead of fixed px), flexible images (max-width: 100% so they scale down), and media queries (CSS that applies different styles at different screen widths).

A "mobile-first" approach is recommended: design for mobile first, then enhance for larger screens with min-width media queries. This ensures the mobile experience is not an afterthought and typically results in better performance on mobile devices.

Example

css
/* Mobile-first responsive grid */
.grid { grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid { grid-template-columns: 2fr 1fr; } }

A grid that starts as one column on mobile and becomes two columns on tablet and larger screens.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary