What Is Responsive Design?
A responsive page adjusts its layout to the screen: one column on a phone, more columns on a laptop. You use one HTML file and CSS that adapts.
Step 1: The Viewport Meta Tag
Without it, phones pretend to be about 980px wide and shrink your page. This tag tells them to use their real width.
Step 2: Mobile First
Write styles for the small screen first, then add larger layouts with min-width media queries.
viewport 400px: 1 column viewport 700px: 2 columns viewport 1000px: 3 columns
Media Query Syntax
| Feature | Checks |
|---|---|
min-width, max-width | Viewport width |
orientation | Portrait or landscape |
prefers-color-scheme | Light or dark mode choice |
prefers-reduced-motion | User wants less animation |
hover: hover | Device has real hover (mouse) |
print | When printing the page |
Choosing Breakpoints
Do not chase device names. Open the page, make the window narrower and add a breakpoint where the layout breaks. Common starting points are around 600px, 900px and 1200px.
A Responsive Navigation
Print Styles
Test in DevTools
- Press F12
- Click the device toolbar icon (a phone and tablet)
- Choose a device or drag the width
- Check there is no sideways scrolling
- Test portrait and landscape
- Test on a real phone when possible
max-width: 100% on images and overflow-wrap: anywhere for long text.
Practice
- Make a three column layout that becomes one column on phones
- Add a dark mode with
prefers-color-scheme - Hide navigation and ads when printing
Conclusion
Use the viewport meta tag, write mobile first CSS and add min-width queries where the design needs them.

