Lesson 18 of 55
HTMLResponsive Design – Meta Viewport and Media Queries
9 min
Course progress33%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 18 of 55
HTML9 min
Keep these ideas in mind as you work through the lesson.
<meta name='viewport' content='width=device-width, initial-scale=1' />
Ensures the page scales correctly on mobile devices and prevents the browser from zooming out to fit the entire page.
@media (max-width: 600px) {
.sidebar { display: none; }
.content { margin: 0; }
}
Combine media queries with Flexbox or CSS Grid to adapt layouts fluidly.
Start with base styles for the smallest screens, then add @media (min-width: …) rules for larger breakpoints. This approach loads only the essential CSS first and reduces unnecessary overrides.
rem – Relative to the root font size; good for scalable typography.vw / vh – 1 % of the viewport width/height.% – Relative to the parent element.<meta name='viewport'> present? ✅min-width for larger screens? ✅Tip: Test your layouts with Chrome DevTools → Device Toolbar to emulate various screen sizes.