Principles of Web Design 6 th Edition. Chapter 12 Responsive Web Design



Similar documents
Responsive Web Design: Media Types/Media Queries/Fluid Images

Responsive Web Design (RWD) Best Practices Guide Version:

Recommendations for Websites Optimization for Mobile Devices Using Mobile Centric CSS. February 2014 Update

Going Beyond SAP ITS Mobile Apps to a Responsive Design Mobile Apps. JK (JayaKumar Pedapudi) Principal Consultant NTT DATA, Inc.

CREATING RESPONSIVE UI FOR WEB STORE USING CSS

Responsive Web Design. birds of feather

This document will describe how you can create your own, fully responsive. drag and drop template to use in the creator.

You can use percentages for both page elements and text. Ems are used for text,

Responsive Web Design in Application Express

RESPONSIVE DESIGN FOR MOBILE RENDERING

Responsive Design How to get started

Chapter 8 More on Links, Layout, and Mobile Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

The Essential Guide to HTML Design

Building Responsive Websites with the Bootstrap 3 Framework

IBM Worklight: Responsive Design for Mul8- Channel Applica8on Development

Treble: One Page Website. Step 8 - Responsive Web Design

Responsive Web Design (RWD) Building a single web site for the desktop, tablet and smartphone

GUIDE TO CODE KILLER RESPONSIVE S

Responsive Web Design for Teachers. Exercise: Building a Responsive Page with the Fluid Grid Layout Feature

White Paper Using PHP Site Assistant to create sites for mobile devices

Building Responsive Layouts

RESPONSIVE DESIGN BY COMMUNIGATOR

Let's Dig Into the Omega Theme October 27,

SellerDeck 2014 Responsive Design Guide

Using Style Sheets for Consistency

DESIGNING MOBILE FRIENDLY S

Responsive Design

DESIGN RESPONSIVELY DRUPAL CAMP CT RESPONSIVE WEB DESIGN AND DRUPAL PROJECT. Monday, August 27, 12

Web layout guidelines for daughter sites of Scotland s Environment

Magento Responsive Theme Design

RESPONSIVE DESIGN

Putting the Design in Responsive Design Best Practices Guide

How To Design A Website For The Decs

Responsive website design for higher education utilizing mobile centric features

Style & Layout in the web: CSS and Bootstrap

CSS for Page Layout. Key Concepts

Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

THE SAS OUTPUT DELIVERY SYSTEM: BOLDLY TAKE YOUR WEB PAGES WHERE THEY HAVE NEVER GONE BEFORE! CHEVELL PARKER, SAS INSTITUTE INC.

Coding HTML Tips, Tricks and Best Practices

Responsive Web Design for Drupal

Madison Area Technical College. MATC Web Style Guide

CSS 101. CSS CODE The code in a style sheet is made up of rules of the following types

Responsive Design Best Practices

Creative Guidelines for s

CST 150 Web Design I CSS Review - In-Class Lab

Responsive web design Are we ready for the new age?

Responsive Web Design: Single Design for multiple devices - A case with UNISWA Library website. John Paul Anbu K.

Outline of CSS: Cascading Style Sheets

PaperlessPrinter. Version 3.0. User s Manual

Responsive Design Guide. The fundamentals of designing and building mobile optimized

Responsive Design: Ben Callahan

Looking Good! Troubleshooting Display Problems

Purdue University Writing Lab Indiana Department of Transportation Workshop Series Dr. David Blakesley, Allen Brizee

A GUIDE TO MOBILE

HOW Interactive Design Conference 2013

Creating Web Pages with Microsoft FrontPage

Creator Coding Guidelines Toolbox

Informz for Mobile Devices: Making Your s PDA and Phone-Friendly

Mobile Web Site Style Guide

Web Design for Programmers. Brian Hogan NAPCS Slides and content 2008 Brian P. Hogan Do not reproduce in any form without permission

JJY s Joomla 1.5 Template Design Tutorial:

Dreamweaver Domain 2: Planning Site Design and Page Layout

Responsive Web Design

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

Fundamentals of Web Design (One Semester)

Web Designing with UI Designing

The Essential Guide to HTML Design

Web Design I. Spring 2009 Kevin Cole Gallaudet University

Web Design & Development - Tutorial 04

Microsoft Publisher 2010 What s New!

Designing HTML ers

Transcription:

Principles of Web Design 6 th Edition Chapter 12 Responsive Web Design

Objectives Recognize the need for responsive web design Use media queries to apply conditional styles Build a basic media query Create flexible responsive layouts Create responsive navigation schemes Use responsive images Build a responsive web page design for desktops, tablets, and smartphones 2

Recognizing the Need for Responsive Web Design 3

Recognizing the Need for Responsive Web Design Tablets and smartphones add to web design challenge More device sizes, screen orientations, and screen resolutions Design responsively rather than for specific devices 4

5

Recognizing the Need for Responsive Web Design Traditional web design techniques do not adapt well to mobile devices Legibility and navigation are challenges Responsive design lets you build a more flexible type of web page that responds to the varying size of mobile displays 6

Recognizing the Need for Responsive Web Design Three main elements of responsive design: CSS media queries Using these expressions, you can apply styles based on display device characteristics Flexible images These images adapt to the parameters of the user s screen size Flexible layouts These layouts realign elements of your content structure based on the display device 7

Recognizing the Need for Responsive Web Design Figure 12 2 shows the responsive design of the World Wildlife Fund web site at five screen resolutions Both page designs are flexible to adapt to sizes above or below the 768 pixel threshold This threshold is called the breakpoint the point at which design layouts change in responsive design schemes 8

9

Recognizing the Need for Responsive Web Design Use CSS style rules to change the order, positioning, and other display characteristics of your page elements Build one basic layout and then use style rules targeted to different screen sizes 10

Recognizing the Need for Responsive Web Design Figure 12 3 shows the range of sizes and the breakpoint used in the style of the World Wildlife site The web site design adapts to larger screen sizes, expanding and adding more content and navigation as the browser widths increase In this example, the breakpoint is set to 768 pixels 11

12

Recognizing the Need for Responsive Web Design Choose a breakpoint and then design for the devices above and below that point Adapt your design for optimal viewing in each range of screen sizes Content, not the device needs, should dictate when you choose breakpoints 13

Recognizing the Need for Responsive Web Design You can control style characteristics including: Adding and removing entire columns Changing navigation Stacking columns on top of each other 14

15

16

Content First Design Think carefully about your content and users needs when building responsive designs Which content is valuable to the user of a smaller device? How much content can be used effectively on each device? Will you have to edit or restructure content? 17

Measurement Units in Responsive Design Breakpoints are best measured in ems Ems are better than pixels because they are flexible It is easier to design in pixels, so convert pixels to ems 1 em equals 16 px 18

Using Media Queries to Apply Conditional Styles 19

Using Media Queries to Apply Conditional Styles Media queries let you create precise rules for destination media. A media query contains both a media type and optional expressions that check conditions called media features Media features include variables such as the width or height of the destination device 20

Using Media Queries to Apply Conditional Styles Figure 12 5: The media type is screen and the media feature is max width. The max width value is 480 pixels. 21

Using Media Queries to Apply Conditional Styles With the addition of the following style rule, the browser will detect the maximum width of the screen. If it is 480 pixels or less, the header element will have a width of 90%. @media screen and (max-width: 480px) { header {width: 90%;} } 22

Using Media Queries to Apply Conditional Styles You can add multiple media features with the and keyword @media screen and (min-width: 480px) and (max-width: 768px) 23

Applying Media Queries You have three options for applying media queries to specify style rules In the following three examples, the styles are applied if the device screen has a maximum width of 480 pixels 24

Applying Media Queries In the first example, the link element applies an external style sheet named mobiledevice.css if the device screen has a maximum width of 480 pixels: <link rel="stylesheet" media="screen and (maxwidth: 480px) href="mobiledevice.css"> 25

Applying Media Queries The second example uses an @import rule to apply an external style sheet named mobiledevice.css if the device has a screen with a maximum width of 480 pixels: @import url("mobiledevice.css") screen and (max-width: 480px); 26

Applying Media Queries The third example uses the @media rule within a <style> element: <style> @media screen and (max-width: 480px) { style rules here } </style> 27

Multiple Style Rules for Three Breakpoints /* smaller than 1024 pixels */ @media screen and (max-width: 1024px) { style rules here } /* smaller than 768 pixels */ @media screen and (max-width: 768px) { style rules here } /* smaller than 480 pixels */ @media screen and (max-width: 480px) { style rules here } 28

Media Types 29

Setting the Viewport Scale The viewport is equal to the size of the browser window The viewport on handheld devices is much narrower than a desktop browser window The narrower viewport causes problems with responsive web pages. Include this meta tag to set the viewport: <meta name="viewport" content="width=device-width, initialscale=1.0"> 30

Creating Flexible Responsive Layouts 31

Creating Flexible Responsive Layouts Combine flexible layout techniques with media queries to extend the use of flexible layouts to adapt to any device size In the following example, the flexible layout works well over 750 pixels wide Under 750 pixels, the user must scroll horizontally 32

33

Creating Flexible Responsive Layouts To solve this problem, the layout s flexibility must be extended to include all screen sizes from smartphones to desktop displays, as shown in Figure 12 9 34

35

Creating Flexible Responsive Layouts This proposed layout works well at any width between the smallest device and 780 pixels Once the design is expanded past 780 pixels, the content is spread too widely across the page The page design can change to take advantage of the larger screen size 36

37

Creating Flexible Responsive Layouts The mockup in Figure 12 11 shows how the page design can adapt to different sizes within the ranges specified by the media queries 38

39

Creating Flexible Responsive Layouts The display property can be used to remove or add content as needed Figure 12 14 shows an example of hiding or displaying content based on the browser width The larger page design takes advantage of expanded screen space, while the smaller mobile design focuses on user navigation and content access 40

41

Creating Responsive Navigation Screens 42

Creating Responsive Navigation Screens When readers access on a smartphone, they have different navigation motives than when using a larger screen Mobile sites should offer the most popular links readily available on the first page Navigating on a small device is much easier when the navigation is direct and accessible 43

44

Using Responsive Images 45

Using Responsive Images When building responsive layouts, consider the behavior of images and how they react to different device sizes You can let images adjust to the browser size or have a fixed size 46

Using Responsive Images Flexible Fixed 47

Using Responsive Images Set the image s height to auto to maintain the aspect ratio when the image is scaled: img { max-width: 100%; height: auto; } 48

Using Responsive Images With a style rule, you can choose to set a minimum fixed width for the image if necessary: img { min-width: 240px; } 49

50

Using Responsive Images You can wrap text around an image in a responsive column Float the image and set a width for the image that is a percentage of the containing column The image style rule sets the width at 40%, down to a minimum width of 200 pixels 51

Using Responsive Images The image style rule sets the width at 40%, down to a minimum width of 200 pixels: img { float: left; width: 40%; height: auto; min-width: 200px; margin: 0 1em 1em 0; } 52

53

Chapter Activity: Building a Responsive Design 54

Activity Objectives Adapt a typical web page design to a responsive web design Determine breakpoints in the content Determine the best responsive content layouts Use media queries to build a set of style rules for the two content breakpoints 55

56

57

58

59

Summary Media queries let you apply conditional styles based on different device properties Responsive web page designs let you create one source of content and use style sheets and media queries to adapt the page design to different devices Design for the needs of the content, not the device Remove or add content as necessary to provide the best experience for the user Use the fewest breakpoints possible, and determine the breakpoints by examining how the content behaves at different browser widths 60