SlideShare une entreprise Scribd logo
1  sur  28
Chapter 5
Responsive Design Part
1: Designing for Mobile
Devices
Web Design with
HTML5 & CSS3
8th Edition
• Explain the principles of responsive design
• Describe the pros and cons of a mobile website
• Explain the design principles of a mobile website
• Describe a mobile-first strategy
• Define a viewport
• Create a fluid layout
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 2
Chapter Objectives
• Make images flexible
• Use styles for a mobile viewport
• Insert and style a span element
• Insert a viewport meta tag
• Test a responsive site using a device emulator
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 3
Chapter Objectives (continued)
• Responsive design
– Responsive design is a website development strategy
that strives to provide an optimal user experience of a
website regardless of the device or browser used
– The content in responsive design is easy to read and
navigate on devices of three sizes: desktop browser,
tablet, and phone
Chapter 5: Creating an Image Map 4
Exploring Responsive Design
• The three concepts of responsive design are:
1. Fluid layout:
– Applies proportional size measurements to the
webpage wireframe and content
– The viewport is the viewing area for the webpage
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 5
Exploring Responsive Design
(continued 1)
2. Media queries
– Allow the webpage developer to detect the
approximate pixel size of the current viewport
– Allow the developer to selectively apply CSS rules
that work best for that viewport size
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 6
Exploring Responsive Design
(continued 2)
3. Flexible images
– They shrink and grow based on the size of the
viewport
– They do not have height and width attributes or
values in the HTML document
– They use CSS rules to resize the image relative to
the wireframe and viewport
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 7
Exploring Responsive Design
(continued 3)
• Mobile websites
– Techniques emerged to build a completely separate,
parallel website optimized for mobile users called a
mobile website to address problems with viewports
– They are identified with an m. or mo. prefix in the
URL
– In contrast, responsive design optimizes the viewing
experience for a wide range of devices using one
website
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 8
Designing for Mobile Devices
• Mobile-first strategy
– Employs responsive design principles
oIn this, a web developer designs the flexible wireframe and
essential content for the smallest viewport first,
progressively adding more content as the viewport grows
oThen, media queries are used to add styles for progressively
larger viewports, progressing from tablet to laptop and
desktop
– It is a more productive and effective way to build a
website from scratch
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 9
Designing for Mobile Devices
(continued 1)
– Implementation of the website development approach
depends on many factors, such as:
othe current environment
othe target audience
oavailable resources
othe time available to tackle the project
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 10
Designing for Mobile Devices
(continued 2)
• Fluid layout
– It is also known as a webpage with a liquid layout
– It changes in width based on the size of the viewport
– Responsive designs are based on fluid layouts
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 11
Using Fluid Layouts
• Fixed layouts
– They do not change in width based on the size of the
viewport
– They use fixed measurement units such as pixels to
define the width of the areas of the wireframe that
“fix” the width of the content regardless of the size of
the viewport
– It is implemented by measuring the widths of the
wireframe elements and content in relative units such
as percentages and ems
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 12
Using Fluid Layouts (continued 1)
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 13
Using Fluid Layouts (continued 2)
• It is created by using percentages to measure the
width of each column in a webpage
• A webpage can have a liquid layout without using
media queries
• No matter how small a browser becomes, the
content placeholder boxes on the page shrink and
grow in response to the size of the viewport
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 14
Creating a Fluid Layout
• To make the navigation links more appealing on a
webpage, they can be formatted so they look like
buttons rather than text links
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 15
Creating a Fluid Layout
(continued 1)
• Figure 5–8 shows a webpage with a liquid layout
in two widths
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 16
Creating a Fluid Layout
(continued 2)
• Flexible image – It resizes itself to accommodate
the size of the viewport and is easy to implement
• Creating flexible images:
1. Delete the height and width attribute values
for the img tags in the HTML files
2. Add styles for the images in the CSS file to
provide the desired flexibility such as the
following style: max-width: 100%;
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 17
Making Images Flexible
• By setting the width of the image to 100%, the
image automatically stretches to fill 100% of the
width of the container element
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 18
Making Images Flexible
(continued)
• It is better to use a single-column layout for a
mobile display as this prevents scrolling
horizontally
• Styling content for mobile devices requires that
each page be analyzed to determine the most
important content on the page, and then style
that content to attract users of mobile devices
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 19
Following a Mobile-First Strategy
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 20
Following a Mobile-First Strategy
(continued 1)
• Figure 5–22a depicts a wireframe example for a
traditional desktop viewport, while Figure 5–22b
depicts all these same areas of content for a
mobile design
• Figure 5–23 shows how to hide some webpage
areas to create a revised mobile wireframe
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 21
Following a Mobile-First Strategy
(continued 2)
• Optimize the interface to maximize the mobile
user experience
• Some of the key best practices when designing for
mobile viewports are as follows:
1. Make use of 100% of the screen space
2. Design the navigation to be easy and intuitive
3. Keep load times minimal. Enhance load times by
removing bandwidth-intensive content and
streamlining your HTML code
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 22
Following a Mobile-First Strategy
(continued 3)
4. Display essential page content and hide
nonessential page content
5. Make the content easy to access and read
6. Design a simple layout
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 23
Following a Mobile-First Strategy
(continued 4)
• span element
– Allows the use of CSS to format a span of text
separately from its surrounding text
– The <span> and </span> are the start and the end
tags
– As an inline element, it can be applied to text
within a block
– A class can be added to a span element to style its
text
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 24
Using the Span Element
– For example, the following code shows a phone
number wrapped in span element.
<span class="desktop">(814) 555-9608</span>
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 25
Using the Span Element
(continued)
• For responsive sites, add the following meta tag to
the head section of each webpage.
<meta name="viewport"
content="width=device-width, initial-
scale=1">
• This code makes sure that the page initially loads
in a layout width that matches the viewport of the
device
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 26
Adding Meta Tags
Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 27
Testing Webpages in Viewports
of Different Sizes
Chapter 5 Complete
HTML
8th Edition

Contenu connexe

En vedette (18)

CSS
CSSCSS
CSS
 
HTML 5 & CSS3
HTML 5 & CSS3HTML 5 & CSS3
HTML 5 & CSS3
 
HTML5 on mobile
HTML5 on mobileHTML5 on mobile
HTML5 on mobile
 
Chapter 19
Chapter 19Chapter 19
Chapter 19
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Chapter 25
Chapter 25Chapter 25
Chapter 25
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 
CSS
CSSCSS
CSS
 
Intro To ECAT
Intro To ECATIntro To ECAT
Intro To ECAT
 
HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08
 
HTML & CSS: Chapter 07
HTML & CSS: Chapter 07HTML & CSS: Chapter 07
HTML & CSS: Chapter 07
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
 
Unit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - VectorsUnit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - Vectors
 
HTML5--The 30,000' View (A fast-paced overview of HTML5)
HTML5--The 30,000' View (A fast-paced overview of HTML5)HTML5--The 30,000' View (A fast-paced overview of HTML5)
HTML5--The 30,000' View (A fast-paced overview of HTML5)
 
Bread board
Bread boardBread board
Bread board
 
Breadboard
BreadboardBreadboard
Breadboard
 
Basic css
Basic cssBasic css
Basic css
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 

Similaire à HTML & CSS: Chapter 05

digital marketing[1].pdf
digital marketing[1].pdfdigital marketing[1].pdf
digital marketing[1].pdfTECHCENTRAL3
 
Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.Sonia Simi
 
Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.Sonia Simi
 
How to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteHow to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteJj Jurgens
 
Responsive Web Designs
Responsive Web DesignsResponsive Web Designs
Responsive Web DesignsSanjida Afrin
 
5 ways to make a responsive website faster
5 ways to make a responsive website faster5 ways to make a responsive website faster
5 ways to make a responsive website fasterMindGee Technologies
 
HTML and Responsive Design
HTML and Responsive Design HTML and Responsive Design
HTML and Responsive Design Mindy McAdams
 
Mastering Responsive Web Design_ Creating Seamless User Experiences.pdf
Mastering Responsive Web Design_ Creating Seamless User Experiences.pdfMastering Responsive Web Design_ Creating Seamless User Experiences.pdf
Mastering Responsive Web Design_ Creating Seamless User Experiences.pdfGerryspeck
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devicesjameswillweb
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)admecindia1
 
Overview of Responsive Web Design
Overview of Responsive Web DesignOverview of Responsive Web Design
Overview of Responsive Web DesignPankaj Bajaj
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 
Why should we build our website responsive
Why should we build our website responsiveWhy should we build our website responsive
Why should we build our website responsiveOmkarsoft Bangalore
 
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveDesign Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveInductive Automation
 
Responsive Web design Zambig
Responsive Web design ZambigResponsive Web design Zambig
Responsive Web design ZambigTribune Media
 
Multiple Design Strategies for Multiple Screens
Multiple Design Strategies for Multiple ScreensMultiple Design Strategies for Multiple Screens
Multiple Design Strategies for Multiple ScreensJanine Warner
 
Designing responsive web design in FIGMA
Designing responsive web design in FIGMADesigning responsive web design in FIGMA
Designing responsive web design in FIGMAFibonalabs
 

Similaire à HTML & CSS: Chapter 05 (20)

digital marketing[1].pdf
digital marketing[1].pdfdigital marketing[1].pdf
digital marketing[1].pdf
 
Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.
 
Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.Introduction | SEO Expate BD Ltd.
Introduction | SEO Expate BD Ltd.
 
How to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteHow to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive Website
 
Responsive Web Designs
Responsive Web DesignsResponsive Web Designs
Responsive Web Designs
 
Mobile Responsive ​ Website Designing.pdf
Mobile Responsive ​ Website Designing.pdfMobile Responsive ​ Website Designing.pdf
Mobile Responsive ​ Website Designing.pdf
 
5 ways to make a responsive website faster
5 ways to make a responsive website faster5 ways to make a responsive website faster
5 ways to make a responsive website faster
 
HTML and Responsive Design
HTML and Responsive Design HTML and Responsive Design
HTML and Responsive Design
 
Mastering Responsive Web Design_ Creating Seamless User Experiences.pdf
Mastering Responsive Web Design_ Creating Seamless User Experiences.pdfMastering Responsive Web Design_ Creating Seamless User Experiences.pdf
Mastering Responsive Web Design_ Creating Seamless User Experiences.pdf
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devices
 
Responsive Web Designing Fundamentals
Responsive Web Designing FundamentalsResponsive Web Designing Fundamentals
Responsive Web Designing Fundamentals
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)
 
Overview of Responsive Web Design
Overview of Responsive Web DesignOverview of Responsive Web Design
Overview of Responsive Web Design
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Why should we build our website responsive
Why should we build our website responsiveWhy should we build our website responsive
Why should we build our website responsive
 
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveDesign Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
 
Responsive Web design Zambig
Responsive Web design ZambigResponsive Web design Zambig
Responsive Web design Zambig
 
Multiple Design Strategies for Multiple Screens
Multiple Design Strategies for Multiple ScreensMultiple Design Strategies for Multiple Screens
Multiple Design Strategies for Multiple Screens
 
Designing responsive web design in FIGMA
Designing responsive web design in FIGMADesigning responsive web design in FIGMA
Designing responsive web design in FIGMA
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 

Plus de Steve Guinan

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationSteve Guinan
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignSteve Guinan
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Steve Guinan
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box ModelSteve Guinan
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsSteve Guinan
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Steve Guinan
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSSSteve Guinan
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web ImagesSteve Guinan
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student InstructionsSteve Guinan
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up TextSteve Guinan
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big ConceptsSteve Guinan
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web WorksSteve Guinan
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting StartedSteve Guinan
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Steve Guinan
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Steve Guinan
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Steve Guinan
 

Plus de Steve Guinan (20)

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
 
Chapter 7: Images
Chapter 7: ImagesChapter 7: Images
Chapter 7: Images
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student Instructions
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up Text
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big Concepts
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting Started
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5
 

Dernier

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Dernier (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

HTML & CSS: Chapter 05

  • 1. Chapter 5 Responsive Design Part 1: Designing for Mobile Devices Web Design with HTML5 & CSS3 8th Edition
  • 2. • Explain the principles of responsive design • Describe the pros and cons of a mobile website • Explain the design principles of a mobile website • Describe a mobile-first strategy • Define a viewport • Create a fluid layout Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 2 Chapter Objectives
  • 3. • Make images flexible • Use styles for a mobile viewport • Insert and style a span element • Insert a viewport meta tag • Test a responsive site using a device emulator Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 3 Chapter Objectives (continued)
  • 4. • Responsive design – Responsive design is a website development strategy that strives to provide an optimal user experience of a website regardless of the device or browser used – The content in responsive design is easy to read and navigate on devices of three sizes: desktop browser, tablet, and phone Chapter 5: Creating an Image Map 4 Exploring Responsive Design
  • 5. • The three concepts of responsive design are: 1. Fluid layout: – Applies proportional size measurements to the webpage wireframe and content – The viewport is the viewing area for the webpage Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 5 Exploring Responsive Design (continued 1)
  • 6. 2. Media queries – Allow the webpage developer to detect the approximate pixel size of the current viewport – Allow the developer to selectively apply CSS rules that work best for that viewport size Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 6 Exploring Responsive Design (continued 2)
  • 7. 3. Flexible images – They shrink and grow based on the size of the viewport – They do not have height and width attributes or values in the HTML document – They use CSS rules to resize the image relative to the wireframe and viewport Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 7 Exploring Responsive Design (continued 3)
  • 8. • Mobile websites – Techniques emerged to build a completely separate, parallel website optimized for mobile users called a mobile website to address problems with viewports – They are identified with an m. or mo. prefix in the URL – In contrast, responsive design optimizes the viewing experience for a wide range of devices using one website Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 8 Designing for Mobile Devices
  • 9. • Mobile-first strategy – Employs responsive design principles oIn this, a web developer designs the flexible wireframe and essential content for the smallest viewport first, progressively adding more content as the viewport grows oThen, media queries are used to add styles for progressively larger viewports, progressing from tablet to laptop and desktop – It is a more productive and effective way to build a website from scratch Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 9 Designing for Mobile Devices (continued 1)
  • 10. – Implementation of the website development approach depends on many factors, such as: othe current environment othe target audience oavailable resources othe time available to tackle the project Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 10 Designing for Mobile Devices (continued 2)
  • 11. • Fluid layout – It is also known as a webpage with a liquid layout – It changes in width based on the size of the viewport – Responsive designs are based on fluid layouts Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 11 Using Fluid Layouts
  • 12. • Fixed layouts – They do not change in width based on the size of the viewport – They use fixed measurement units such as pixels to define the width of the areas of the wireframe that “fix” the width of the content regardless of the size of the viewport – It is implemented by measuring the widths of the wireframe elements and content in relative units such as percentages and ems Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 12 Using Fluid Layouts (continued 1)
  • 13. Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 13 Using Fluid Layouts (continued 2)
  • 14. • It is created by using percentages to measure the width of each column in a webpage • A webpage can have a liquid layout without using media queries • No matter how small a browser becomes, the content placeholder boxes on the page shrink and grow in response to the size of the viewport Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 14 Creating a Fluid Layout
  • 15. • To make the navigation links more appealing on a webpage, they can be formatted so they look like buttons rather than text links Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 15 Creating a Fluid Layout (continued 1)
  • 16. • Figure 5–8 shows a webpage with a liquid layout in two widths Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 16 Creating a Fluid Layout (continued 2)
  • 17. • Flexible image – It resizes itself to accommodate the size of the viewport and is easy to implement • Creating flexible images: 1. Delete the height and width attribute values for the img tags in the HTML files 2. Add styles for the images in the CSS file to provide the desired flexibility such as the following style: max-width: 100%; Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 17 Making Images Flexible
  • 18. • By setting the width of the image to 100%, the image automatically stretches to fill 100% of the width of the container element Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 18 Making Images Flexible (continued)
  • 19. • It is better to use a single-column layout for a mobile display as this prevents scrolling horizontally • Styling content for mobile devices requires that each page be analyzed to determine the most important content on the page, and then style that content to attract users of mobile devices Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 19 Following a Mobile-First Strategy
  • 20. Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 20 Following a Mobile-First Strategy (continued 1) • Figure 5–22a depicts a wireframe example for a traditional desktop viewport, while Figure 5–22b depicts all these same areas of content for a mobile design
  • 21. • Figure 5–23 shows how to hide some webpage areas to create a revised mobile wireframe Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 21 Following a Mobile-First Strategy (continued 2)
  • 22. • Optimize the interface to maximize the mobile user experience • Some of the key best practices when designing for mobile viewports are as follows: 1. Make use of 100% of the screen space 2. Design the navigation to be easy and intuitive 3. Keep load times minimal. Enhance load times by removing bandwidth-intensive content and streamlining your HTML code Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 22 Following a Mobile-First Strategy (continued 3)
  • 23. 4. Display essential page content and hide nonessential page content 5. Make the content easy to access and read 6. Design a simple layout Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 23 Following a Mobile-First Strategy (continued 4)
  • 24. • span element – Allows the use of CSS to format a span of text separately from its surrounding text – The <span> and </span> are the start and the end tags – As an inline element, it can be applied to text within a block – A class can be added to a span element to style its text Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 24 Using the Span Element
  • 25. – For example, the following code shows a phone number wrapped in span element. <span class="desktop">(814) 555-9608</span> Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 25 Using the Span Element (continued)
  • 26. • For responsive sites, add the following meta tag to the head section of each webpage. <meta name="viewport" content="width=device-width, initial- scale=1"> • This code makes sure that the page initially loads in a layout width that matches the viewport of the device Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 26 Adding Meta Tags
  • 27. Chapter 5: Responsive Design Part 1: Designing for Mobile Devices 27 Testing Webpages in Viewports of Different Sizes