introduction to responsive design v.2

178
Introduction to Responsive Web Design version 2.0 Clarissa Peterson @clarissa

Upload: clarissa-peterson

Post on 27-Jan-2015

115 views

Category:

Design


4 download

DESCRIPTION

This is the same workshop from August, but about 40 new slides, mostly at the end. A hands-on workshop for DC Web Women on September 11, 2012.

TRANSCRIPT

Page 1: Introduction to Responsive Design v.2

Introduction toResponsive Web Design

version 2.0

Clarissa Peterson@clarissa

Page 2: Introduction to Responsive Design v.2

a workshop for theDC Web WomenCode(Her) Series

September 11, 2012

Page 3: Introduction to Responsive Design v.2

1. What is responsive web design

2. Where it came from

3. Example sites

4. Hands-on demonstration

5. Other things you should know

6. Q&A

Page 4: Introduction to Responsive Design v.2

Responsive Web Design

Page 5: Introduction to Responsive Design v.2

Responsive Web Design

Page 6: Introduction to Responsive Design v.2

Responsive Web Design

A collection of techniques that allowyour website to respond to the device

that it is being viewed on.

Page 7: Introduction to Responsive Design v.2

Responsive Web Design

A collection of techniques that allowyour website to respond to the device

that it is being viewed on.

This allows all users to have an optimal experience without creating separate sites for different devices.

Page 8: Introduction to Responsive Design v.2

http://www.bostonglobe.com/

Page 9: Introduction to Responsive Design v.2

http://www.bostonglobe.com/

Page 10: Introduction to Responsive Design v.2

http://www.bostonglobe.com/

Page 11: Introduction to Responsive Design v.2

http://www.bostonglobe.com/

Page 12: Introduction to Responsive Design v.2

1. A flexible, grid-based layout

2. Flexible images and media

3. Media queries

Page 13: Introduction to Responsive Design v.2

HTML

Page 14: Introduction to Responsive Design v.2

Markup Language

Page 15: Introduction to Responsive Design v.2

First website: http://www.w3.org/History/19921103-hypertext/hypertext/WWW/TheProject.html

Page 16: Introduction to Responsive Design v.2

<p>...</p>

<h1>...</h1>

<a href=””>...</a>

Page 17: Introduction to Responsive Design v.2

<hp1>...</hp1>

(highlighting)

Page 18: Introduction to Responsive Design v.2

<blink>...</blink>

Page 19: Introduction to Responsive Design v.2

Control:

HTML tablesspacer gifs

Page 20: Introduction to Responsive Design v.2

Cascading Style Sheets (CSS)

Page 21: Introduction to Responsive Design v.2

HTML

CSS

Content

Presentation

Page 23: Introduction to Responsive Design v.2

Designing for one canvas.

Page 24: Introduction to Responsive Design v.2

Brendan Gates via Creative Commons http://flic.kr/p/dvX1J

Page 25: Introduction to Responsive Design v.2

Curtis Palmer via Creative Commons http://flic.kr/p/wyPiC

Page 26: Introduction to Responsive Design v.2

Designing for unlimited canvases?

Page 27: Introduction to Responsive Design v.2

Brad Frost via Creative Commons http://flic.kr/p/cfQwL7

Page 28: Introduction to Responsive Design v.2

The web is free from the physical restraints of the canvas

Page 29: Introduction to Responsive Design v.2

Clarissa Peterson via Creative Commons (CC BY-NC-SA 2.0)

Page 30: Introduction to Responsive Design v.2

Paulo Fierro via Creative Commons http://flic.kr/p/ae8Nnr

Page 31: Introduction to Responsive Design v.2

http://www.alistapart.com/articles/responsive-web-design/

Responsive web design offers us a way forward, finally allowing us to “design for the ebb and flow of things.”

- Ethan Marcotte

Page 32: Introduction to Responsive Design v.2

Responsive Web Design http://www.abookapart.com/products/responsive-web-design/

Page 33: Introduction to Responsive Design v.2

Responsive Architecture

Page 34: Introduction to Responsive Design v.2

Tristan Sterk via Creative Commons http://commons.wikimedia.org/wiki/File:ResponsiveEnvelope1.jpg

Page 35: Introduction to Responsive Design v.2

It’s easy to build a houseon flat land with four walls.

Page 36: Introduction to Responsive Design v.2

© Clarissa Peterson

Page 37: Introduction to Responsive Design v.2

Work around the environment.

Page 38: Introduction to Responsive Design v.2

© Clarissa Peterson

Page 39: Introduction to Responsive Design v.2

Think about design differently.

Page 40: Introduction to Responsive Design v.2

© Clarissa Peterson

Page 41: Introduction to Responsive Design v.2

A website with a responsivedesign is no longer just a

picture on a canvas.

Page 42: Introduction to Responsive Design v.2

A Few Examplesof Responsive Design

Page 43: Introduction to Responsive Design v.2

Smashing Magazinehttp://www.smashingmagazine.com

People (mobile site)http://m.people.com

United Pixelworkershttp://www.unitedpixelworkers.com/

Page 44: Introduction to Responsive Design v.2

World Wildlife Fundhttp://worldwildlife.org/

Stuff & Nonsensehttp://www.stuffandnonsense.co.uk/

Emeril’s Restaurantshttp://www.emerilsrestaurants.com/

Page 45: Introduction to Responsive Design v.2

Andersson-Wise Architectshttp://www.anderssonwise.com

Federal Government: AIDS.govhttp://aids.gov

WordPress Theme: Twenty Twelvehttp://twentytwelvedemo.wordpress.com/

Page 46: Introduction to Responsive Design v.2

Two Approaches

Page 47: Introduction to Responsive Design v.2

1. Start from scratch

2. Make an existing designmore responsive

Page 48: Introduction to Responsive Design v.2

download files for hands-on exercise here: clarissapeterson.com/files/dcww/

open in your text editor: style.css

open in your browser: demo.html

Page 49: Introduction to Responsive Design v.2

Example 1 in style.css like this

If you’re doing this at home, please note that each section of code is marked at the bottom of the slide with an example number that you can look for in your style.css file.

Page 50: Introduction to Responsive Design v.2

Older Browsers:

Some of this won’t work in older browsers, so you’ll need to do some

extra stuff to make it work.

(read the book....)

Page 51: Introduction to Responsive Design v.2
Page 52: Introduction to Responsive Design v.2

1. A flexible, grid-based layout

2. Flexible images and media

3. Media queries

Page 53: Introduction to Responsive Design v.2
Page 54: Introduction to Responsive Design v.2

Columns provide structure.

Page 55: Introduction to Responsive Design v.2

http://www.bostonglobe.com/

Page 56: Introduction to Responsive Design v.2
Page 57: Introduction to Responsive Design v.2

target ÷ context = result

Page 58: Introduction to Responsive Design v.2

target ÷ context = result

___px ÷ 1280px = __%

Page 59: Introduction to Responsive Design v.2

(but you don’t actually needto remember the formula)

Page 60: Introduction to Responsive Design v.2

Example 1 in style.css

<div class="site">! ...</div>

Page 61: Introduction to Responsive Design v.2
Page 62: Introduction to Responsive Design v.2

Example 1 in style.css

.site { ! width: 1280px;}

Page 63: Introduction to Responsive Design v.2

Example 1 in style.css

.site { ! width: 100%; }

Page 64: Introduction to Responsive Design v.2

Example 2 in style.css

<div id="heading">! ...</div>

Page 65: Introduction to Responsive Design v.2
Page 66: Introduction to Responsive Design v.2

Example 2 in style.css

#heading { ! background-color: #fff; ! width: 960px;! margin: 1.5em auto;! text-align:right;}

Page 67: Introduction to Responsive Design v.2

Example 2 in style.css

#heading { ! background-color: #fff; ! width: 75%;! margin: 1.5em auto;! text-align:right;}

Page 68: Introduction to Responsive Design v.2

Example 3 in style.css

<div id="promowrapper"><img src="promoimage.jpg" alt="Attend seminars, networking events, and more." />

</div>

Page 69: Introduction to Responsive Design v.2
Page 70: Introduction to Responsive Design v.2

Example 3 in style.css

#promowrapper {! margin: 0 auto;! width: 960px;}

Page 71: Introduction to Responsive Design v.2

Example 3 in style.css

#promowrapper {! margin: 0 auto;! width: 75%;}

Page 72: Introduction to Responsive Design v.2

Example 4 in style.css

<div id="content"> ...</div>

Page 73: Introduction to Responsive Design v.2
Page 74: Introduction to Responsive Design v.2

Example 4 in style.css

#content { ! background-color: #fff; ! width: 960px; ! margin: auto; }

Page 75: Introduction to Responsive Design v.2

Example 4 in style.css

#content { ! background-color: #fff; ! width: 75%; ! margin: auto; }

Page 76: Introduction to Responsive Design v.2

Example 4 in style.css

<div id=”content”> <div class="contentbox"> <h2>Who We Are</h2>

...

</div>

...

</div>

Page 77: Introduction to Responsive Design v.2
Page 78: Introduction to Responsive Design v.2

Example 4 in style.css

.contentbox { ! width: 300px;! float:left; ! padding: 2em 30px 2em 0; }

Page 79: Introduction to Responsive Design v.2

Example 4 in style.css

.contentbox { ! width: 31.25%;! float:left; ! padding: 2em 30px 2em 0; }

Page 80: Introduction to Responsive Design v.2

Example 4 in style.css

.contentbox { ! width: 31.25%;! float:left; ! padding: 2em 30px 2em 0; }

Page 81: Introduction to Responsive Design v.2

Example 4 in style.css

.contentbox { ! width: 31.25%;! float:left; ! padding: 2em 3.125% 2em 0; }

Page 82: Introduction to Responsive Design v.2

Example 5 in style.css

<div id="footercontent"> ...</div>

Page 83: Introduction to Responsive Design v.2
Page 84: Introduction to Responsive Design v.2

Example 5 in style.css

#footercontent { ! width: 960px; ! margin: auto; ! color: #fff; }

Page 85: Introduction to Responsive Design v.2

Example 5 in style.css

#footercontent { ! width: 75%; ! margin: auto; ! color: #fff; }

Page 86: Introduction to Responsive Design v.2
Page 87: Introduction to Responsive Design v.2

1. A flexible, grid-based layout

2. Flexible images and media

3. Media queries

Page 88: Introduction to Responsive Design v.2
Page 89: Introduction to Responsive Design v.2

Example 3 in style.css

<div id="promowrapper"><img src="promoimage.jpg" alt="..." /></div>

#promowrapper {! margin: 0 auto;! width: 75%;}

Page 90: Introduction to Responsive Design v.2

Example 3 in style.css

#promo img { ! margin: 2em 0;}

Page 91: Introduction to Responsive Design v.2

Example 3 in style.css

#promo img { ! margin: 2em 0;! max-width: 100%;}

Page 92: Introduction to Responsive Design v.2
Page 93: Introduction to Responsive Design v.2

Don’t set the width and heightattributes of the image

Page 94: Introduction to Responsive Design v.2

Also:embed

object

video

Page 95: Introduction to Responsive Design v.2
Page 96: Introduction to Responsive Design v.2

1. A flexible, grid-based layout

2. Flexible images and media

3. Media queries

Page 97: Introduction to Responsive Design v.2

<link rel="stylesheet" href="style.css" media=”print” />

Page 98: Introduction to Responsive Design v.2

h1 { color: #f00; }p { color: #333; }

@media print {! h1 { color: #0f0; }! p { color: #099; }}

Page 99: Introduction to Responsive Design v.2

h1 { color: #f00; }p { color: #333; }

@media print {! h1 { color: #0f0; }! p { color: #099; }}

Page 100: Introduction to Responsive Design v.2

h1 { color: #f00; }p { color: #333; }

@media print {! h1 { color: #0f0; }! p { color: #099; }}

Page 101: Introduction to Responsive Design v.2

h1 { color: #f00; }p { color: #333; }

@media print {! h1 { color: #0f0; }! p { color: #099; }}

Page 102: Introduction to Responsive Design v.2

@media screen {! ...}

Page 103: Introduction to Responsive Design v.2

@media screen and (min-width: 1024px) {! ...}

Page 104: Introduction to Responsive Design v.2

@media screen and (min-width: 768px) and (max-width: 1024px) {! ...}

Page 105: Introduction to Responsive Design v.2

min-device-width: 00pxmax-device-width: 00px

orientation: landscapeorientation: portrait

device-aspect-ratio: 16/9

min-color-index: 256

min-resolution: 300dpi

Page 106: Introduction to Responsive Design v.2
Page 107: Introduction to Responsive Design v.2

Example 6 in style.css

@media screen and (max-width: 1100px) { ! #navbox { ! !! !! !! }}

Page 108: Introduction to Responsive Design v.2

Example 6 in style.css

@media screen and (max-width: 1100px) { ! #navbox { ! ! clear: left;! !! !! }}

Page 109: Introduction to Responsive Design v.2
Page 110: Introduction to Responsive Design v.2

Example 6 in style.css

@media screen and (max-width: 1100px) { ! #navbox { ! ! clear: left;! ! padding-top: 0;! !! }}

Page 111: Introduction to Responsive Design v.2
Page 112: Introduction to Responsive Design v.2

Example 6 in style.css

@media screen and (max-width: 1100px) { ! #navbox { ! ! clear: left;! ! padding-top: 0;! ! text-align: center;! }}

Page 113: Introduction to Responsive Design v.2
Page 114: Introduction to Responsive Design v.2
Page 115: Introduction to Responsive Design v.2
Page 116: Introduction to Responsive Design v.2

Example 7 on style.css

@media screen and (max-width: 500px) { ! .nav li { ! ! ! !! !! }}

Page 117: Introduction to Responsive Design v.2

Example 7 on style.css

@media screen and (max-width: 500px) { ! .nav li { ! ! display: block; ! !! !! }}

Page 118: Introduction to Responsive Design v.2
Page 119: Introduction to Responsive Design v.2

Example 7 on style.css

@media screen and (max-width: 500px) { ! .nav li { ! ! display: block; ! ! margin-left: 0; ! ! padding-bottom: 5px;! }}

Page 120: Introduction to Responsive Design v.2
Page 121: Introduction to Responsive Design v.2

Example 7 on style.css

@media screen and (max-width: 500px) {

! ...

! .logo { ! ! float: none;! ! text-align: center;! }}

Page 122: Introduction to Responsive Design v.2
Page 123: Introduction to Responsive Design v.2
Page 124: Introduction to Responsive Design v.2

Example 7 on style.css

@media screen and (max-width: 500px) {

! ...

! .contentbox { ! ! width: 100%; ! ! ! ! ! }}

Page 125: Introduction to Responsive Design v.2
Page 126: Introduction to Responsive Design v.2

Example 7 on style.css

@media screen and (max-width: 500px) {

! ...

! .contentbox { ! ! width: 100%; ! ! float: none; ! ! padding: 25px 0 0; ! }}

Page 127: Introduction to Responsive Design v.2
Page 128: Introduction to Responsive Design v.2

Breakpoints

Page 129: Introduction to Responsive Design v.2

(where the design breaks)

Page 130: Introduction to Responsive Design v.2

Commonly-Used Breakpoints

Device Type Width

Mobile phones (portrait) 320px

Mobile phones (landscape) 480px

7” tablets (portrait) 600px

10” tablets (portrait) 768px

10” tablets (landscape), Monitors 1024px

Wider monitors 1280px

Page 131: Introduction to Responsive Design v.2

But what happens whenthere are new devices?

Page 132: Introduction to Responsive Design v.2

Break when the design tells you to.

Page 133: Introduction to Responsive Design v.2

Options:

Page 134: Introduction to Responsive Design v.2

Options:Ignore Mobile?

Page 135: Introduction to Responsive Design v.2

Options:Ignore Mobile?

Separate Mobile Site

Page 136: Introduction to Responsive Design v.2

Options:Ignore Mobile?

Separate Mobile Site

Native Mobile App

Page 137: Introduction to Responsive Design v.2

Options:Ignore Mobile?

Separate Mobile Site

Native Mobile App

Responsive Design

Page 138: Introduction to Responsive Design v.2

Your boss saying you needa mobile app is not a good

reason to make a mobile app.

Page 139: Introduction to Responsive Design v.2

Mobile First

Page 140: Introduction to Responsive Design v.2

Start from the smallest screen,determine which parts of the designare truly necessary, and make those

the basis of your design.

Page 141: Introduction to Responsive Design v.2

Mobile first = better userexperience across devices

Page 142: Introduction to Responsive Design v.2

Mobile-Only Users

Page 143: Introduction to Responsive Design v.2

Consider bandwidth

Page 144: Introduction to Responsive Design v.2

Older Browsers:

Give them default CSS that they can understand.

Page 145: Introduction to Responsive Design v.2

Device Testing(if you don’t have devices)

Page 146: Introduction to Responsive Design v.2

Clarissa Peterson via Creative Commons (CC BY-NC-SA 2.0)

Page 147: Introduction to Responsive Design v.2

Test early, test often

Page 148: Introduction to Responsive Design v.2

Test at Various Widths

tools such as:

resizemybrowser.com

quirktools.com/screenfly/

Page 149: Introduction to Responsive Design v.2

Use a Mobile Emulator

such as:

mobilephoneemulator.com

Page 150: Introduction to Responsive Design v.2

Smartphones

Feature Phones

Tablets

Page 151: Introduction to Responsive Design v.2

Touch Interaction

Page 152: Introduction to Responsive Design v.2

Desktop Browsers

Mobile Browsers

Page 153: Introduction to Responsive Design v.2

Device Lab DC

devicelabdc.com

Page 154: Introduction to Responsive Design v.2

Responsive Process

Page 155: Introduction to Responsive Design v.2

How to explain responsivedesign to (internal/external) clients

Page 156: Introduction to Responsive Design v.2

The design won’t look thesame on every browser/device

Page 157: Introduction to Responsive Design v.2

Static comps aren’t enough

Page 158: Introduction to Responsive Design v.2

Style Tiles

Page 159: Introduction to Responsive Design v.2

Style Tilesfonts, colors, interface elements

Page 160: Introduction to Responsive Design v.2

Style Tilesfonts, colors, interface elements

communicate the essence of a visual brand for the web

Page 161: Introduction to Responsive Design v.2

Style Tiles via Creative Commons http://styletil.es/

Page 162: Introduction to Responsive Design v.2

Style Tileshelp form a common visual

language between thedesigners and the stakeholders

Page 163: Introduction to Responsive Design v.2

Style Tiles via Creative Commons http://styletil.es/

Page 164: Introduction to Responsive Design v.2

Photoshop is for photos

InDesign is for design & typography

Page 165: Introduction to Responsive Design v.2

Design

Develop

Page 166: Introduction to Responsive Design v.2

Design doesn’t endwhen development begins

Page 167: Introduction to Responsive Design v.2

Content First

Page 168: Introduction to Responsive Design v.2

Users aren’t coming to yoursite because it’s pretty,

they’re coming for the content.

Page 169: Introduction to Responsive Design v.2

Responsive Design:We are free of the canvas.

Page 170: Introduction to Responsive Design v.2

Q&A

Page 171: Introduction to Responsive Design v.2

Resources

Page 172: Introduction to Responsive Design v.2

Books

Ethan MarcotteResponsive Web Design (2011)http://www.abookapart.com/products/responsive-web-design/

Luke WroblewskiMobile First (2011)http://www.abookapart.com/products/mobile-first

Page 173: Introduction to Responsive Design v.2

ArticlesResponsive Web Design - Ethan Marcotte (May 2010)http://www.alistapart.com/articles/responsive-web-design/

How to Approach a Responsive Design (Boston Globe) - Tito Bottitta (Jan. 2012)http://upstatement.com/blog/2012/01/how-to-approach-a-responsive-design/

50 Fantastic Tools for Responsive Web Design - Denise Jacobs, Peter Gasston (Apr. 2012)http://www.netmagazine.com/features/50-fantastic-tools-responsive-web-design

Design Process In The Responsive Age - Drew Clemens (May 2012)http://uxdesign.smashingmagazine.com/2012/05/30/design-process-responsive-age/

Making of: People Magazine's Responsive Mobile Website (July 2012)http://globalmoxie.com/blog/making-of-people-mobile.shtml

3 Types of Solutions To Work With Responsive Images - Steven Bradley (July 2012)http://www.vanseodesign.com/web-design/responsive-images/

Page 174: Introduction to Responsive Design v.2

More ArticlesThe Top Responsive Web Design Problems and How to Avoid Them - James Young (Aug. 2012)http://www.netmagazine.com/features/top-responsive-web-design-problems-and-how-avoid-them

Presidential Smackdown Edition: Separate Mobile Website Vs. Responsive Website - Brad Frost (Aug. 2012)http://mobile.smashingmagazine.com/2012/08/22/separate-mobile-responsive-website-presidential-smackdown/

Responsive Design Case Study (South Tees Hospitals NHS Foundation Trust) - Matt Berridge (Aug. 2012)http://builtbyboon.com/blog/responsive-design-case-study

MiscellaneousSomeone asked how I measure things on the screen:

MeasureIt (Firefox add-on)https://addons.mozilla.org/en-US/firefox/addon/measureit/

Page 175: Introduction to Responsive Design v.2

Websites@RWDlinks about responsive design (Ethan Marcotte)https://twitter.com/RWD

Future Friendlymaking things that are future-friendlyhttp://futurefriend.ly/

Brad Frostblog that covers responsive designhttp://bradfrostweb.com/blog/

Mediaqueri.esinspirational websites using media queries and responsive web designhttp://mediaqueri.es/

Page 176: Introduction to Responsive Design v.2

Other Information

DC Web WomenA professional organization of more than 3000 members located in the Washington, DC area. Members are professional women, students and enthusiasts who specialize in web-related fields.http://www.dcwebwomen.org/

We Are All AwesomeBe a role model: why there should be more female speakers at tech conferences. Resources on creating presentations, getting ideas, writing proposals, and finding conferences with open CFPs.http://weareallaweso.me/

Page 177: Introduction to Responsive Design v.2

Mount Rainier. Clarissa Peterson via Creative Commons (CC BY-NC-SA 2.0)