Apply the Web Platform Viewport and Layout Fundamentals
Overview
Responsive design works best when content determines breakpoints and layout adapts continuously between common screen sizes.
Configure the viewport correctly
A mobile-friendly document should include a viewport meta tag so the layout viewport matches the device width. Avoid disabling user zoom. Use CSS pixels and responsive constraints rather than assuming physical screen dimensions.
<meta name="viewport" content="width=device-width, initial-scale=1">
Prefer fluid layout primitives
Use Grid and Flexbox for relationships between content areas. Combine relative units, minmax(), clamp(), and max-width constraints to prevent content from becoming too wide or too cramped. Let text wrap naturally and avoid fixed heights for content containers unless the design truly requires them.
Choose breakpoints from content pressure
Add a breakpoint when the current layout stops working, not because a device model is popular. Test intermediate widths, long translations, browser zoom, and mobile landscape. A layout that works at 390px and 1280px may still fail at 760px.
Respect user preferences
Support reduced motion where animation is nonessential, preserve visible focus, and check contrast in both light and dark contexts if both are supported. Responsive design includes input methods, zoom, and user settings, not only width.
Implementation checklist
- Define the expected behavior and supported environments.
- Keep security, accessibility, and failure states in the design.
- Measure the result with representative user journeys.
- Document operational assumptions and review them after changes.