introduction to responsive web design

14
“The control which designers know in the print medium, and often desire in the web medium, is simply a function of the limitation of the printed page. We should embrace the fact that the web doesn’t have the same constraints, and design for this flexibility.” – John Allsop, "A Dao of Web Design" http://alistapart.com/article/dao

Upload: melanie-burger

Post on 27-Jan-2015

181 views

Category:

Technology


1 download

DESCRIPTION

A brief introduction to responsive web design presented to Biomedical Communications (MScBMC) students on March 15, 2013.

TRANSCRIPT

Page 1: Introduction to Responsive Web Design

“The control which designers know in the print medium, and often desire in the web medium, is simply a function of the limitation of the printed page. We should embrace the fact that the web doesn’t have the same constraints, and design for this flexibility.” – John Allsop, "A Dao of Web Design"

http://alistapart.com/article/dao

Page 2: Introduction to Responsive Web Design

http://www.english.utoronto.ca/Page4.aspx

Responsive: http://www.microsoft.com/en-ca/default.aspx

Not responsive:

Page 3: Introduction to Responsive Web Design

Front-end ingredients for RWD:1. Flexible grid2. Flexible media3. Media queries

http://alistapart.com/article/responsive-web-design

Page 4: Introduction to Responsive Web Design

Instead of pixels, use proportional units:h1 {font-size: 1.5 em} Exercise: rwd_flexTypeSTART.html, rwd_snippets.html

Flexible Grid

Page 5: Introduction to Responsive Web Design

target ÷ context = result eg. 24px ÷ 16px = 1.5em• Also applies to grid dimension• Can avoid context considerations with remsExercise: rwd_miniFlexGridDemoSTART.html, snippets.html

http://aralbalkan.com/notes/pixel-parity-rems/

Flexible Grid

Page 6: Introduction to Responsive Web Design

img, embed, object, video {max-width: 100%}Exercise: rwd_miniFlexGridDemoSTART.html, snippets.html

github.com/filamentgroup/Responsive-Images/

Flexible Media

Page 7: Introduction to Responsive Web Design

Image considerations: Scaling vs. large downloads1. Serve as a background-image and swap at

break-points2. Use image.js to serve the appropriate size

image

github.com/filamentgroup/Responsive-Images/

Flexible Media

Page 8: Introduction to Responsive Web Design

“At some point everything breaks.” – Ethan Marcotte, “Responsive Web Design”

• Media queries are used to solve breakpoints• Responsive websites usually have at least 3

breakpoints• Trend is towards device agnosticismExercise (open in Google): http://bradfrost.github.com/this-is-responsive

Media Queries

Page 9: Introduction to Responsive Web Design

@media screen and (min-width: 1024px) { body{font-size = 100%} }

Syntax:• media type• keyword• 1+ expression

http://www.w3.org/TR/CSS2/media.htmlhttps://developer.mozilla.org/en/docs/CSS/Media_queries#Media_features

Media Queries

Page 10: Introduction to Responsive Web Design

https://developer.mozilla.org/en/docs/CSS/Media_queries#Media_features

Media Queries

Page 11: Introduction to Responsive Web Design

https://github.com/scottjehl/Respondhttp://caniuse.com/#search=media%20queries

Media Queries

Page 12: Introduction to Responsive Web Design

• “Mobile first”, work up from smallest target device

• Design to look right, not for the device size• Test, redesign, test, rinse, repeat:

• Test user-defined breakpoints: http://www.benjaminkeen.com/open-source-projects/smaller-projects/responsive-design-bookmarklet/

• Test preset breakpoints: http://www.responsinator.com/• Test with animated preset breakpoints:

http://responsive.is/typecast.com• This test comes with measurement bars: http://screenqueri.es/

Design Advice

Page 13: Introduction to Responsive Web Design

Maybe RWD is not right for you, but fixed-width is no longer viable.

• RWD is Google and Bing’s recommended configuration• Responsive e-commerce sites see 333% transactions• RWD is in-line with W3C goal of “One Web”

http://www.lukew.com/ff/entry.asp?1509http://googlewebmastercentral.blogspot.ca/2012/06/recommendations-for-building-smartphone.htmlhttp://electricpulp.com/notes/more-on-apples-mobile-optimization-in-ecommerce/http://www.w3.org/TR/mobile-bp/#OneWeb

Final Thoughts

Page 14: Introduction to Responsive Web Design

Recommended reading• http://alistapart.com/article/responsive-web-

design• "Responsive Web Design” by Ethan Marcotte

Useful Resources• A px to em math tool: http://pxtoem.com/• Responsive grid resources: • http://goldengridsystem.com/• http://www.responsivegridsystem.com/• http://foundation.zurb.com/• http://twitter.github.com/bootstrap/• http://www.tinyfluidgrid.com/