Designing Effective Websites Day 5 - May 1 Did you find any URLs - - PowerPoint PPT Presentation

designing effective websites
SMART_READER_LITE
LIVE PREVIEW

Designing Effective Websites Day 5 - May 1 Did you find any URLs - - PowerPoint PPT Presentation

Designing Effective Websites Day 5 - May 1 Did you find any URLs like these? Have you come across URL' like these: Building a Mobile Website Some opt to build a separate (secondary) site for mobile Not necessarily a flawed approach


slide-1
SLIDE 1

Designing Effective Websites

Day 5 - May 1

slide-2
SLIDE 2

Did you find any URLs like these?

  • Have you come across URL' like these:
slide-3
SLIDE 3

Building a Mobile Website

  • Some opt to build a separate (secondary) site

for mobile

  • Not necessarily a flawed approach
  • For some, it has a valid business case
slide-4
SLIDE 4

For the rest of us…

  • Avoid duplication of effort
  • Want a "more robust" solution
  • Be prepared for the coming unknown
  • Adaptable
slide-5
SLIDE 5

Reference

  • Using CSS, we adapt our

page's layout based on screen width

  • Many sources of information
  • n the topic
  • Ethan Marcotte's Responsive

Web Design (A Book Apart)

slide-6
SLIDE 6

Ingredients for Responsive Web Design (RWD)

  • A flexible, grid-based layout
  • Flexible images and media
  • Media Queries
slide-7
SLIDE 7

Fixed Layout

  • Web pages created at a specific pixel width.
  • Emulates print design.
  • Maintains relationship of page elements,

alignment, and line lengths

  • …regardless of available screen space
slide-8
SLIDE 8

Advantages of Fixed

  • Predictable and offers better control over line

length.

  • Easier to design and produce.
slide-9
SLIDE 9

Disadvantages of Fixed

  • Content on the right edge will be hidden if the

browser window is smaller than the page.

  • May be an awkward amount of left over space
  • n large screens.
  • Line lengths may grow awkwardly short at very

large text sizes.

  • Takes control away from the user.
slide-10
SLIDE 10

Fluid Layout

  • Page area and columns within the page get

wider or narrower to fill the available space.

  • There is no attempt to control the width of the

content or line breaks.

  • The text is permitted to reflow as required.
slide-11
SLIDE 11

Fluid Advantages

  • Keeps with spirit and nature of the medium.
  • They avoid potentially awkward empty space

because the text fills the window.

  • Users have control of the width.
  • No horizontal scrollbars.
slide-12
SLIDE 12

Fluid Disadvantages

  • On large monitors, line lengths can get very long

and hard to read.

  • Less predictable.
  • Achieving white space may prove difficult.
  • Requires more attention to dimensional

measurements.

slide-13
SLIDE 13

Grid-based Layout

  • For some, the concept of a grid-

based layout may be familiar.

  • Traditionally, we would layout a

fixed page design based on some type of grid.

  • Example taken from Marcotte’s

book

slide-14
SLIDE 14
slide-15
SLIDE 15

Typesetting for RWD

  • Much of the content we put on the web today is

still textual.

  • Starting point of RWD is we need to make the

text of our site responsive.

  • Traditionally, the practice has been to set font

size based on pixels.

slide-16
SLIDE 16

Proportional Typesetting

  • Common practice is to set fonts based on pixels

(px).

  • Today, we need to think proportionally.
  • Rather than using pixels, we need to start using

ems.

slide-17
SLIDE 17

Viewport vs. Device Width

  • Viewport - the "canvas" that mobile browsers use

to render (display) a web page.

  • Device Width - mobile browsers often shrink this

viewport down to fit the width of their screen or device width.

slide-18
SLIDE 18

Viewport Example - iPhone

  • On an iPhone, Mobile Safari

sets the viewport width to 980 pixels

  • Safari then shrinks this to 320

pixels to display in the actual width of the iPhone

  • An example of this can be

seen by viewing the New York Times (www.nytimes.com) Desktop page

320 px

slide-19
SLIDE 19

From Flexible Fonts to a Flexible Layout

  • Just as we made our text proportional, we can

apply that same approach to other visual elements of our design.

  • We no longer use unchanging, inflexible pixels.
  • We express size in terms of proportions or

percentages

slide-20
SLIDE 20

Setting the Viewport

  • One of the first things we need to do to prepare
  • ur site, is to set the Viewport.
  • We want to "take control" of what and how our

content is to be displayed.

  • Possible by adding a meta element to the head
  • f our HTML document:

<meta name="viewport" content="width=device-width, initial- scale=1.0">

slide-21
SLIDE 21

Making Images Flexible

  • In its simplest form, all we need to do is add the

following to our stylesheet:

img { max-width: 100%; }

slide-22
SLIDE 22

Media Queries

  • Allow designers to deliver styles based on

media types.

  • The defined media types are print, screen,

handheld, braille, projection, screen, tty, and tv.

  • The keyword “all” indicates that the styles apply

to all media types.

slide-23
SLIDE 23

Media Queries

  • Can also evaluate specific media features such

as device-width, orientation, and resolution.

  • Most properties can be tested for a minimum or

maximum value using the min- or max- prefixes.

slide-24
SLIDE 24

Other Media Features We Can Check

slide-25
SLIDE 25

Defining a Media Query

  • Starts with the @media keyword
  • Followed by the target media type (e.g., screen)
  • The media feature and the value being tested,

contained in parentheses

  • The styles to be applied for those browsers

meeting the criteria appear in a set curly braces {}

slide-26
SLIDE 26

A Typical Media Query

@media screen and (max- width: 700px;) { margin: 1em 5% 1em 25%; }

slide-27
SLIDE 27

Media Query Example 1

  • Testing screen width and orientation:

@media screen and (max-width: 700px;) and (orientation: landscape;) { /* styling for devices / browsers that pass */ }

slide-28
SLIDE 28

Media Query example 2

@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (-moz-min-device-pixel-ratio: 2), screen and (-o-min-device-pixel-ratio: 2), screen and (min-device-pixel-ratio: 2) { /* styles referencing high-resolution images here */ }

slide-29
SLIDE 29

Breakpoint Chart

slide-30
SLIDE 30

Other Challenges of Responsive Web Design

  • "Responsive" Images

How do we get the right sized image delivered to smaller screens that may also be mobile

  • Does One Size Fit All?

Is a Responsive Design appropriate for our site / app?