MOBILE FIRST /// MEDIA QUERIES /// FLUID GRIDS /// FLEXBOX /// VIEWPORT ///

Responsive Design

Design for the continuum. Master Media Queries, Fluid Typography, and adaptable Grid systems to fit any screen on earth.

responsive.css
1 / 14
12345
📱💻

Tutor:Welcome to Responsive Design! In the 90s, websites were fixed width. Today, they must look great on an Apple Watch, a Phone, a Tablet, and a 4K Monitor.


Skill Matrix

ADAPT OR PERISH.

Media Queries

The bread and butter of responsive design. Apply styles conditionally based on screen width.

System Check

Which approach is considered best practice?


Community Holo-Net

Showcase Your Layouts

ACTIVE

Built a killer Grid layout? Share your codepens and get feedback!

Responsive Design: Adapt or Perish

Frontend Instructor in Code Syllabus

Pascual Vila

Frontend Instructor // Code Syllabus

"You do not design for a specific screen size. You design for an infinite continuum of sizes. The web is fluid, your layouts should be too."

The Viewport Meta Tag

Without the viewport meta tag, mobile devices assume your site is designed for desktop (usually ~980px wide) and scale it down to fit the screen. The result? Unreadable text and tiny buttons.

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

Mobile-First Strategy

Historically, developers built desktop sites first, then wrote media queries to shrink things for mobile. This required overriding complex layouts.

Mobile-First flips this. You write the mobile styles as your baseline (no media queries). Then, you use min-width media queries to progressively enhance the layout for tablets and desktops. This is cleaner, faster to render, and ensures the core content is prioritized.

Fluid Units (vw, vh, rem, %)

  • Percentage (%): Relative to the parent element. Perfect for fluid containers.
  • Viewport Units (vw, vh): 1vw is 1% of the viewport width. Great for hero sections (height: 100vh).
  • rems: Relative to the root HTML font-size. Never use px for fonts; use rem to respect user accessibility settings.

Frequently Asked Questions

Responsive vs. Adaptive Web Design?

Responsive: Fluid layouts that smoothly change at any width using relative units and flexible grids.

Adaptive: Uses distinct layouts for specific screen sizes (e.g., exactly 320px, 768px, 1024px). It snaps between layouts. Responsive is considered the modern best practice.

How do I avoid using too many Media Queries?

Lean heavily on CSS Grid and Flexbox. Using properties like flex-wrap: wrap or grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) allows the browser to calculate when to stack elements without you having to hardcode breakpoints.

Responsive Glossary

Viewport
The user's visible area of a web page. Varies by device.
snippet.css
@media
CSS rule to apply styles only if certain conditions (like min-width) are met.
snippet.css
Mobile-First
Writing base CSS for mobile devices, then using min-width to enhance for larger screens.
snippet.css
Fluid Images
Ensuring images scale down relative to their container, preventing overflow.
snippet.css
rem (root em)
Relative length unit based on the root font-size. Crucial for accessible typography.
snippet.css
Grid auto-fit
Magical CSS Grid property that creates fully fluid responsive columns without queries.
snippet.css