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

Ditch the App, Go Responsive!

Ditch the App, Go Responsive!

Presentation I gave at the ACP journalism convention in San Francisco. Details and notes: http://danoc.me/talks/responsive/

Avatar for Daniel O'Connor

Daniel O'Connor

March 02, 2013
Tweet

Other Decks in Technology

Transcript

  1. TIME Oct. 2012 • First fully responsive global news site

    • Continue to support their mobile application
  2. Ditch the App! • Existing solutions... ◦ don't make sense

    economically ◦ poorly designed ◦ glorified RSS readers • Custom apps are expensive/hard to build • Must support multiple operating systems • Where's the demand?
  3. Fluid layout • Layout should adjust to the browser viewport

    • Use percentages instead of pixels for width #main { float: left; width: 65%; } #sidebar { float: left; width: 35%; } <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>The HTML5 Herald</title> <link rel="stylesheet" href=" style.css"> </head> <body> <div id="main">Main</div> <div id="sidebar">Sidebar</div> </body> </html>
  4. Flexible images and media • Images and media should resize

    with browser • Max-width of img, embed, object, and video img, embed, object, video { max-width: 100%; }
  5. Media Queries • Adapt the layout to smaller devices •

    Target each breakpoint in the layout @media only screen and (max-width : 980px) { #search-form .search-bar { width: 180px; } }
  6. Viewport • Mobile browsers assume website was designed for desktop

    • Specify viewport to notify the browser: <meta name="viewport" content="initial-scale=1.0, width=device-width" />
  7. Advanced Issues • Images are too large for mobile: http://adaptive-images.com/

    • IE 6-8 doesn't support media queries: https://github.com/scottjehl/Respond • Detect viewport with Javascript: http://responsejs.com/labs/dimensions/