Unit 6 ยท Cascading Style Sheets (CSS)

6.6Responsive Web Page Design

Users visit from phones, tablets, laptops and TVs. A responsive page adapts its layout to the screen size. Three ingredients: the viewport meta tag, flexible layouts, and media queries.

Step 0: viewport tag (already in our template; without it phones show a shrunken desktop page):

HTML
<meta name='viewport' content='width=device-width, initial-scale=1.0'>

Flexible images:

CSS
img { max-width: 100%; height: auto; }