HTML & CSS Masterclass Tutorial

Comprehensive guide to modern HTML and CSS development.

Responsive Design

Responsive Design & Media Queries

Responsive web design makes your web page look good on all devices (desktops, tablets, and phones).

The Viewport Meta Tag

Always include <meta name="viewport" content="width=device-width, initial-scale=1.0"> in your HTML head.

Media Queries

Media queries allow you to apply different CSS rules based on the size of the screen. The industry standard is Mobile-First Design: you write the default CSS for mobile phones, and use @media (min-width: ...) to add styling for larger screens.

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics