Responsive Design

Week 7

CDGD304 - Fall 2011
http://bit.ly/massart-web304-7

Order of Business

  1. Final Project Design Critiques

  2. Responsive Design

  3. Flexible Grids

  4. Flexible Images

  5. Media Queries

  6. Exercises

Homework Review

Responsive Design

What does that mean?

(according to Ethan Marcotte)

A flexible grid (with flexible images) that incorporates media queries to create a responsive, adaptive layout.

Responsive design means:

Also, it’s kinda hard.

Why it’s hard

Why it’s awesome

So What is Responsive Design?

Flexible Grid
Flexible Images
Media Queries

How?

Are these Responsive Design?

Flexible Grids

Flexible/Fluid Grids

Maintaining Layouts

Bryan Rieger, “Rethinking the Mobile Web”

Containers

Responsive Containers

Responsive Containers Max Width

Flexible Images

should be as easy as
img { max-width:100% }

Make this image flexible

Max-Width is our friend

Well, not ie6's friend - use a condition include and target width:100% instead

Sizing text and setting in em's

Treat Fonts as Proportions Not Pixels

16px is the normal 100% default (from our reset)

the golden formula is target ÷ context = result

context is our base size (in this case 16px)

target is what we set (the size of our header might be 24px)

24 ÷ 16 = 1.5

Reseting the font size

16px is the normal 100% default (from our reset)

adjusting in em's (target ÷ context = result)

Media Queries

Media Types

ex.
@media screen and (min-width:600px) and (max-width:1200px)

Enter Media Queries

Responsive Containers Stack

What about adjusting our text sizes?

Floating Elements

Other stuff we can do

"Breakpoints"

When does your design break? How can you adjust your page to respond?

Exercises

#1: Fix the image, #2: Style the titles larger, #3: Add another break point at 400px, #4: Adjust the title and body font size for each breakpoint, #5: Hide the sidebar under 400px, #6: Show the content block #mobile-nav under 400px;

Setting the Viewport

What about other features?

Examples

Where to use?

Discussion..

Homework

Reading

Design