Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Responsive Web Design

Responsive Web Design

You may have heard about this this 'Responsive Web Design' thing that's taking the web by storm. Fluid grids and media queries are helping websites adapt their layouts to better suit screen widths, but there's also a host of performance optimization techniques that, when used in conjunction with content- and mobile-first design, allow responsive web design to help us create truly universal yet mobile-optimized web experiences. In this talk, Matt will blitz through an overview of basic responsive web development, before diving a little deeper into some of the trickier techniques that will help you develop outstanding, mobile-performant universal web products.

Matt Menzer

July 02, 2012
Tweet

More Decks by Matt Menzer

Other Decks in Technology

Transcript

  1. This is our way forward. Rather than tailoring disconnected designs

    to each of an ever- increasing number of web devices, we can treat them as facets of the same experience... In short, we need to practice responsive web design. ETHAN MARCOTTE
  2. .embed { position: relative; padding-bottom: 56.25%; height: 0; } .embed

    object { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } WORKS FOR ALL INTRINSIC RATIO!
  3. WHAT ABOUT IE? <link rel="stylesheet" href="/css/global.css" media="all"> <link rel="stylesheet" href="/css/layout.css"

    media="all and (min-width: 30em)"> <!--[if lt IE 9]> <link rel="stylesheet" href="/css/layout.css" media="all"> <![endif]--> Bypass Media Queries
  4. MOBILE FIRST @media only screen and (min-width: 50em) { .a-row

    { overflow: hidden; } .a-1of2 { width: 50% } .a-1of3 { width: 33.3333% } } Breakpoints != Devices
  5. MOBILE FIRST @media only screen and (min-width: 75em) { .a-row

    { overflow: visible; } .b-row { overflow: hidden; } .b-1of4 { width: 25% } } Breakpoints != Devices
  6. RESPONSIVE IMAGES Hello, JavaScript! 1. Mobile default 2. Don’t download

    unnecessary extras 3. Robust query parameters 4. Individual asset control
  7. <picture alt=”Alt text”> <source src=”small.jpg”> <source src="medium.jpg" media="(min- width: 400px)">

    <source src="large.jpg" media="(min- width: 800px)"> <img src="small.jpg" alt="Alt text"> </picture>
  8. RESPONSIVE IMAGES Not quite... 1. Mobile default 2. Don’t download

    unnecessary extras 3. Robust query parameters (meh?) 4. Individual asset control
  9. Google recommends webmasters follow the industry best practice of using

    responsive web design, namely serving the same HTML for all devices and using only CSS media queries to decide the rendering on each device. GOOGLE https://developers.google.com/webmasters/ smartphone-sites/
  10. We can design for an optimal viewing experience, but embed

    standards-based technologies into our designs to make them not only more exible, but more adaptive to the media that renders them. ETHAN MARCOTTE