Responsive Web Design
A responsive page adapts to the screen: columns stack on phones and spread out on desktops. You need the viewport meta tag, flexible widths and CSS media queries.
Start designing for the smallest screen and add rules for larger ones with min-width queries.
Example
<style>
.cols { display: flex; flex-wrap: wrap; gap: 8px; }
.cols div { flex: 1 1 140px; background: #bbf7d0; padding: 16px; }
</style>
<div class="cols">
<div>One</div><div>Two</div><div>Three</div>
</div>Exercise
Allow flex items to move to the next line.
.cols { display: flex; flex-wrap: ; }
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.