SlideShare une entreprise Scribd logo
1  sur  39
Richa Goel
Contents
• Fluid layouts
• Difference between fixed and fluid layouts
• Designing fluid layouts for different screen
  resolutions
• What is responsive web design
• Principles of responsive web design
• Web page coding best practices
Fixed and Fluid Layouts




                          4
Fixed-width and Fluid Layouts
    • Fixed-width layout: Web designer defines exact size of
      every table element in absolute units such as pixels.
       – Gives designer precise control over appearance, but does
         not take into account the size of the browser window
    • Fluid layout: one or more table elements are sized as a
      percentage of the page width
       – Page content flows into blank areas as the size of the
         browser window increases, but sometimes results in long
         lines of text




5
Elastic Layouts
• Some designers propose the use of elastic
  layouts, in which all measurements are expressed
  relative to the default font size using the em unit

• If a user or the designer increases the font
  size, the width, height, and location of all of the
  other page elements, including images, change to
  match



                                          New Perspectives on
                                          HTML and CSS, 6th     6
                                          Edition
Floating Elements
• Floating an element takes that element out of
  the normal flow of the document and positions it
  along the left or right edge of its containing
  element
      float: position;




                                                     7
Floating Elements
• Clearing a float
       clear: position;




                          8
Flexible Layout: Example 1


 <h1>Digital Media Showcase <a href="https://showc.org">
         Read more &raquo;</a></h1>




                                                           -9 -
Flexible Layout: Example 1


start styling it
<style>
body { background-color: #DCDBD9;
          color: #2C2C2C;
          font: normal 100% Cambria, Georgia, serif;
}


slight changes:

heavy serifs; grey background




                                                       -10 -
Flexible Layout: Example 1


traditional styling in px:

h1 { font-size: 24px;
   font-style: italic;
   font-weight: normal;
}
h1 a { color: #747474;
   font: bold 11px Calibri, Optima, Arial, sans-serif;
   letter-spacing: 3.6px;
   text-transform: uppercase;
   text-decoration: none;
}




                                                         -11 -
Flexible Layout: Step 1


To create a flexible version, we
move to ems. (What's an em?)

The 'average' width of a character, in current default font.
originally: the width of the 'm' character

"Contextual healing":
   Our 'target' font size is 24px.
   Our 'context' font size is 16 px – the containing element's
         default size for h1.
   so let's scale h1 to result = target/context = 24/16 = 1.5em
   and likewise, h1 a to 11/24 = 0.4583333333333 em




                                                               -12 -
Flexible Layout: Step 1

styled in ems:

h1 { font-size: 1.5em;   /* 24 px/36 px */
   font-style: italic;
   font-weight: normal;
}
h1 a { color: #747474;
   font: bold 0.458333333333em Calibri, Optima, Arial, sans-serif;

                  /* 11px/24px */
letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
}




                                                             -13 -
Why 11/24 not 11/16?


The <a> is INSIDE the <h1> (see?)

<h1>Digital Media Showcase <a href="https://showc.org">
         Read more &raquo;</a></h1>
and so the CONTEXT of the <a> has its default set to 24px
   in the original example, or (1.5em in the relative version)

So the desired RELATIVE SIZE of the <a> is 11/24.




                                                                 -14 -
Flexible Everything


• Fluid or Liquid Layouts

• Proportionally Scaled Images

• Media Queries
Flexible Everything –
 Flexible Layout

• Use percents and ems

• Don’t use finite values like pixels

• How do you convert? It’s easy:

     .figure {width: 20.833%; /* 200px / 960px */ }

     .headerText {font-size: 0.75em; /* 12px / 16px */ }
Flexible Everything -
Proportionally Scaled
Images


• Hiding and Revealing Portions of Images

• Deliver different images depending on
device

• Foreground Images That Scale With the
Layout
Flexible Everything –
  Media Queries

• They’ve been around since CSS 2.1

• You’ve already used them

  <link rel="stylesheet" type="text/css" href=“screen.css"
  media="screen" />
   <link rel="stylesheet" type="text/css" href="print.css" media="print"
  />


• When CSS3 came out the W3C extended media
queries
Who needs RWD?
You need RWD if:
• You’re starting from scratch.
• You want to keep costs low
• You want it to work even when new devices are released
Responsive web design is the concept of
developing a website in a way that helps the
   layout adjust according to the user’s
       computer screen resolution.
Why is it
        relevant?
RWD allows us to tweak the layout and
present the relevant information first:
hours, phone number, directions and perhaps
a link to the menu.

Meanwhile back at your desk, the restaurant’s
page has all the bells and whistles you didn’t
care for while browsing on your phone.
Food Sense
Clean Air Commute Chall
FlexSlider
You get the point!
Responsive Web
 Design
RWD is the concept of
developing a website in a
way that allows the
layout to adjust
according to the
user’s screen resolution
(view port) using media
queries
Responsive Web
Design
Why?
• Regular websites are almost useless on
  mobile devices
• Creating 'mobile' versions of websites is
  impractical
• New devices constantly appear
• Life is all about change; get with it!
                                    -28 -
CSS3 & Media
         Queries
In your CSS:
@media screen and (min-width: 480px) {
  .content { float: left; }
  .social_icons { display: none }
  // and so on...
}
CSS3 & Media
          Queries
On the header of your website:

<link rel="stylesheet" href="this.css"
media="(min-width: 960px)">
CSS3 & Media
      Queries
By restricting CSS rules to a certain
width of the device displaying a web
page, one can tailor the page's
representation to devices with varying
screen resolution (view port).
Popular Viewport
      Sizes
How do we
design for RWD
Simple:
Use the Mobile First Approach
and favor Progressive
Enhancement instead of the
traditional Graceful
Degradation
Graceful
          Degradation
• Focuses on building the website for the most
  advanced/capable browsers.

• Older browsers are expected to have a poor,
  but passable experience.

• Small fixes may be made to accommodate a
  particular browser ( they are not the focus )
Progressive
          Enhancement
• Focuses on the content. ( not browsers )

• Think from the content out. ( Peanut M&M )
  – Peanut: Content marked up in rich semantic (x)html
  – Coated with rich creamy CSS
  – Added JS as the hard candy shell
Progressive
            Enhancement
Progressive Enhancement consists of the
following core principles:
•basic content and functionality should be accessible to all
web browsers
•semantic markup contains all content
•enhanced layout  external CSS
•enhanced behavior  external JavaScript
•end-user web browser preferences are respected
Progressive
       Enhancement
Benefits:
•Accessibility: PE pages are by
nature more accessible.
•SEO: Since basic content is always
accessible
Best Coding Practices
• Always close your tags
• Declare the Correct DocType
• Never Use Inline Styles
• Place all External CSS Files Within the
  Head Tag
• Consider Placing Javascript Files at the
  Bottom
• Keep Your Tag Names Lowercase
Best Coding Practices
• Wrap Navigation with an Unordered List
• All Images Require “Alt” Attributes
• Use a CSS Reset
• If Building a Blog, Save the H1 for the
  Article Title
• Work with tables intelligently

Contenu connexe

Tendances

20130714 php matsuri - highly available php
20130714   php matsuri - highly available php20130714   php matsuri - highly available php
20130714 php matsuri - highly available php
Graham Weldon
 

Tendances (20)

Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen Grids
 
Cascade.ss
Cascade.ssCascade.ss
Cascade.ss
 
Ppt ch09
Ppt ch09Ppt ch09
Ppt ch09
 
Advance java session 9
Advance java session 9Advance java session 9
Advance java session 9
 
LESS CSS
LESS CSSLESS CSS
LESS CSS
 
Improving Performance on Magento 1*
Improving Performance on Magento 1*Improving Performance on Magento 1*
Improving Performance on Magento 1*
 
Less
LessLess
Less
 
Php Bascis
Php BascisPhp Bascis
Php Bascis
 
Ppt ch07
Ppt ch07Ppt ch07
Ppt ch07
 
Developer skills
Developer skillsDeveloper skills
Developer skills
 
Less css
Less cssLess css
Less css
 
20130714 php matsuri - highly available php
20130714   php matsuri - highly available php20130714   php matsuri - highly available php
20130714 php matsuri - highly available php
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
 
Creating a Reusable Drupal Website for Higher Education - at USG Tech Day
Creating a Reusable Drupal Website for Higher Education - at USG Tech DayCreating a Reusable Drupal Website for Higher Education - at USG Tech Day
Creating a Reusable Drupal Website for Higher Education - at USG Tech Day
 
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreCreating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
 
Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS Introduction
 
CSS3 and Advanced Design
CSS3 and Advanced DesignCSS3 and Advanced Design
CSS3 and Advanced Design
 
Functional Css
Functional CssFunctional Css
Functional Css
 
Intro to Bootstrap
Intro to BootstrapIntro to Bootstrap
Intro to Bootstrap
 
Ruby on Rails from an ASP.NET Perspective
Ruby on Rails from an ASP.NET PerspectiveRuby on Rails from an ASP.NET Perspective
Ruby on Rails from an ASP.NET Perspective
 

En vedette (7)

Php
PhpPhp
Php
 
AngularJS
AngularJSAngularJS
AngularJS
 
PHP 2
PHP 2PHP 2
PHP 2
 
Quality in software industry
Quality in software industryQuality in software industry
Quality in software industry
 
Web Application Testing
Web Application TestingWeb Application Testing
Web Application Testing
 
Wordpress Intro
Wordpress IntroWordpress Intro
Wordpress Intro
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 

Similaire à Responsive web design

Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...
Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...
Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...
gravityworksdd
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 

Similaire à Responsive web design (20)

Team styles
Team stylesTeam styles
Team styles
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...
Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...
Responsive Web Design: From Mobile To Desktop, And Beyond (updated for MobiDe...
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
WEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxWEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptx
 
Responsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needsResponsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needs
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
web development
web developmentweb development
web development
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013
 
25444215.pptx
25444215.pptx25444215.pptx
25444215.pptx
 
web development
web developmentweb development
web development
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Design responsively
Design responsivelyDesign responsively
Design responsively
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Web Programming Basic topic.pptx
Web Programming Basic topic.pptxWeb Programming Basic topic.pptx
Web Programming Basic topic.pptx
 
Web Campaign 2.pptx
Web Campaign 2.pptxWeb Campaign 2.pptx
Web Campaign 2.pptx
 
Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)
 
CSS
CSSCSS
CSS
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Css
CssCss
Css
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Responsive web design

  • 2. Contents • Fluid layouts • Difference between fixed and fluid layouts • Designing fluid layouts for different screen resolutions • What is responsive web design • Principles of responsive web design • Web page coding best practices
  • 3.
  • 4. Fixed and Fluid Layouts 4
  • 5. Fixed-width and Fluid Layouts • Fixed-width layout: Web designer defines exact size of every table element in absolute units such as pixels. – Gives designer precise control over appearance, but does not take into account the size of the browser window • Fluid layout: one or more table elements are sized as a percentage of the page width – Page content flows into blank areas as the size of the browser window increases, but sometimes results in long lines of text 5
  • 6. Elastic Layouts • Some designers propose the use of elastic layouts, in which all measurements are expressed relative to the default font size using the em unit • If a user or the designer increases the font size, the width, height, and location of all of the other page elements, including images, change to match New Perspectives on HTML and CSS, 6th 6 Edition
  • 7. Floating Elements • Floating an element takes that element out of the normal flow of the document and positions it along the left or right edge of its containing element float: position; 7
  • 8. Floating Elements • Clearing a float clear: position; 8
  • 9. Flexible Layout: Example 1 <h1>Digital Media Showcase <a href="https://showc.org"> Read more &raquo;</a></h1> -9 -
  • 10. Flexible Layout: Example 1 start styling it <style> body { background-color: #DCDBD9; color: #2C2C2C; font: normal 100% Cambria, Georgia, serif; } slight changes: heavy serifs; grey background -10 -
  • 11. Flexible Layout: Example 1 traditional styling in px: h1 { font-size: 24px; font-style: italic; font-weight: normal; } h1 a { color: #747474; font: bold 11px Calibri, Optima, Arial, sans-serif; letter-spacing: 3.6px; text-transform: uppercase; text-decoration: none; } -11 -
  • 12. Flexible Layout: Step 1 To create a flexible version, we move to ems. (What's an em?) The 'average' width of a character, in current default font. originally: the width of the 'm' character "Contextual healing": Our 'target' font size is 24px. Our 'context' font size is 16 px – the containing element's default size for h1. so let's scale h1 to result = target/context = 24/16 = 1.5em and likewise, h1 a to 11/24 = 0.4583333333333 em -12 -
  • 13. Flexible Layout: Step 1 styled in ems: h1 { font-size: 1.5em; /* 24 px/36 px */ font-style: italic; font-weight: normal; } h1 a { color: #747474; font: bold 0.458333333333em Calibri, Optima, Arial, sans-serif; /* 11px/24px */ letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; } -13 -
  • 14. Why 11/24 not 11/16? The <a> is INSIDE the <h1> (see?) <h1>Digital Media Showcase <a href="https://showc.org"> Read more &raquo;</a></h1> and so the CONTEXT of the <a> has its default set to 24px in the original example, or (1.5em in the relative version) So the desired RELATIVE SIZE of the <a> is 11/24. -14 -
  • 15. Flexible Everything • Fluid or Liquid Layouts • Proportionally Scaled Images • Media Queries
  • 16. Flexible Everything – Flexible Layout • Use percents and ems • Don’t use finite values like pixels • How do you convert? It’s easy: .figure {width: 20.833%; /* 200px / 960px */ } .headerText {font-size: 0.75em; /* 12px / 16px */ }
  • 17. Flexible Everything - Proportionally Scaled Images • Hiding and Revealing Portions of Images • Deliver different images depending on device • Foreground Images That Scale With the Layout
  • 18. Flexible Everything – Media Queries • They’ve been around since CSS 2.1 • You’ve already used them <link rel="stylesheet" type="text/css" href=“screen.css" media="screen" /> <link rel="stylesheet" type="text/css" href="print.css" media="print" /> • When CSS3 came out the W3C extended media queries
  • 19.
  • 20. Who needs RWD? You need RWD if: • You’re starting from scratch. • You want to keep costs low • You want it to work even when new devices are released
  • 21. Responsive web design is the concept of developing a website in a way that helps the layout adjust according to the user’s computer screen resolution.
  • 22. Why is it relevant? RWD allows us to tweak the layout and present the relevant information first: hours, phone number, directions and perhaps a link to the menu. Meanwhile back at your desk, the restaurant’s page has all the bells and whistles you didn’t care for while browsing on your phone.
  • 26. You get the point!
  • 27. Responsive Web Design RWD is the concept of developing a website in a way that allows the layout to adjust according to the user’s screen resolution (view port) using media queries
  • 28. Responsive Web Design Why? • Regular websites are almost useless on mobile devices • Creating 'mobile' versions of websites is impractical • New devices constantly appear • Life is all about change; get with it! -28 -
  • 29. CSS3 & Media Queries In your CSS: @media screen and (min-width: 480px) { .content { float: left; } .social_icons { display: none } // and so on... }
  • 30. CSS3 & Media Queries On the header of your website: <link rel="stylesheet" href="this.css" media="(min-width: 960px)">
  • 31. CSS3 & Media Queries By restricting CSS rules to a certain width of the device displaying a web page, one can tailor the page's representation to devices with varying screen resolution (view port).
  • 33. How do we design for RWD Simple: Use the Mobile First Approach and favor Progressive Enhancement instead of the traditional Graceful Degradation
  • 34. Graceful Degradation • Focuses on building the website for the most advanced/capable browsers. • Older browsers are expected to have a poor, but passable experience. • Small fixes may be made to accommodate a particular browser ( they are not the focus )
  • 35. Progressive Enhancement • Focuses on the content. ( not browsers ) • Think from the content out. ( Peanut M&M ) – Peanut: Content marked up in rich semantic (x)html – Coated with rich creamy CSS – Added JS as the hard candy shell
  • 36. Progressive Enhancement Progressive Enhancement consists of the following core principles: •basic content and functionality should be accessible to all web browsers •semantic markup contains all content •enhanced layout  external CSS •enhanced behavior  external JavaScript •end-user web browser preferences are respected
  • 37. Progressive Enhancement Benefits: •Accessibility: PE pages are by nature more accessible. •SEO: Since basic content is always accessible
  • 38. Best Coding Practices • Always close your tags • Declare the Correct DocType • Never Use Inline Styles • Place all External CSS Files Within the Head Tag • Consider Placing Javascript Files at the Bottom • Keep Your Tag Names Lowercase
  • 39. Best Coding Practices • Wrap Navigation with an Unordered List • All Images Require “Alt” Attributes • Use a CSS Reset • If Building a Blog, Save the H1 for the Article Title • Work with tables intelligently

Notes de l'éditeur

  1. Most of us should be familiar with Flexible our Fluid layouts. This is the practice of using percents and “ems” as your unit of measurement rather than using finite values like pixels.While this does allow the layout to resize based on screen size, it doesn’t necessary optimize the experience.An em was originally equal to the size of the metal block used to cut a single letter of type for a specific font. It was roughly equivalent to the width of a capital letter “M”.
  2. A media query allows us to target not only certain device classes, but to actually inspect the physical characteristics of the device rendering our work.
  3. YOU’RE STARTING FROM SCRATCHDeveloping a whole new website or web application is a challenging process. You won’t know if the site will be successful until it’s live and in the world, so creating a separate mobile site or a mobile app in tandem with a website project could be a big waste time and money. It’s more efficient to get your new site performing well before you create an additional mobile site or application.YOU WANT TO KEEP COSTS LOWSolid responsive solutions require additional design and front-end development time, but doesn’t too heavily impact application development. It could take around 20-30 per cent longer to develop a responsive site, but it’s still faster than creating an additional mobile site or app. Developing a site this way also means that you only need to develop, manage, and maintain the one site, so it can reduce these costs too.YOU WANT IT TO WORK EVEN WHEN NEW DEVICES ARE RELEASEDA mobile site needs to be able to recognize the user’s device; when new devices are released, the site needs to be updated. As the responsive solution only recognizes the browser’s width, no new updates would need to be made. This means it’s much more future-proof and scalable.
  4. Source: http://designmodo.com/responsive-design-examples/#ixzz1dqSBtv2u
  5. Responsive web design is the concept of developing a website in a way that helps the layout adjust according to the user’s computer screen resolution.