Responsive Web Design

Media Queries, Fluid Layouts and graphics

What does "Responsive Web Design" mean?

  • Designing for multiple device resolutions (computer screens, phones, tablets, tvs, etc.)
readability

The technique:

  1. Detect device resolution with CSS3 Media Queries

  2. Write resolution specific CSS

  3. Use fluid grids and images for all other resolutions

Media Query example

This CSS rule only applies to small screens

@media screen and (max-width: 600px) {
  .class {
    background: #ccc;
  }
}

This manages viewport zoom on WebKit browsers

<meta name="viewport" content="width=960px; user-scalable=1;">

Ethan Marcotte

Ethan Marcotte Books Ethan Marcotte

Examples:

modal

Non-examples of responsive design:

Using browser detection to serve a completely different code base.

modal

Pros & Cons

    Pros:

  • Great UX potential
  • One code base
  • Future-proof

    Cons:

  • Difficult on complex sites
  • Multiple design iterations
  • CSS can become complex

Responsive Design vs. Web App vs. Native App?

  • Responsive = unified code base
  • Web App = more robust
  • Native = more performant
  • Based on business needs
  • More design, dev, and testing = $$$

Reading

reading

Assignment

Begin applying responsive design techniques to your website.

Questions

?