Responsive Design with Progressive Enhancement

suggest change

Modern browsers support media queries directly. No JavaScript media-query polyfill or conditional Internet Explorer stylesheet is needed.

Start with a layout suitable for limited space, then enhance it when more space is available:

.layout {
  display: grid;
  gap: 1rem;
}

@media (width >= 48rem) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 18rem;
  }
}

Choose breakpoints according to the content rather than named devices. Use media queries for viewport or user preferences, and container queries when a reusable component should respond to the space provided by its parent.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents