SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Responsive Web Design
    by Sophy Prak
Sophy Prak
                    Web Developer - Web Essentials
                  Member of KTUG(typo3cambodia.org)




Photo: http://goo.gl/Et5Py
Introduction
●   May 25th, 2010 Ethan Marcotte has wrote article “Responsive Web
    Design” (http://goo.gl/BLQMe)
●   Jun 18, 2010 SIMON COLLISON updated his blog with media
    queries(colly.com)




                                    3
4
Adaptive
(Multiple Fixed Width Layouts)

             or

    Responsive
(Multiple Fluid Grid Layouts)




              5
Mixed Approach
Fixed width for large and medium
      Fluid width for small




               6
Why do we use Responsive
       Web Design?



           7
Should we create sub-domain
 and design layout for each
          devices?



             8
9
10
11
12
Answer

 NO!



  13
“Day by day, the number of devices, platforms,
and browsers that need to work with your site
grows. Responsive web design represents a
fundamental shift in how we’ll build websites
for the decade to come.”

                   - Jeffrey Veen




                       14
“Responsive design will become even better as
we get tools, like Flexible Box and the Grid
Layout spec”

                   - Eric Meyer




                       15
One site for every screen




                     - John Polacek
            16
Who is using it?



        17
london.msn.co.uk




http://www.barackobama.com/




                              18
www.barackobama.com




http://www.barackobama.com/




                              19
www.smashingmagazine.com




http://www.smashingmagazine.com/



                                   20
www.bostonglobe.com




http://www.bostonglobe.com




                             21
Other sites

●   http://css-tricks.com/
●   http://webdesignerwall.com/
●   For more http://mediaqueri.es/




                                     22
Responsive Web Design
●   Key Elements of Responsive Web Design
    ●   Flexible Layout
    ●   Flexible Images and Media
    ●   Media Queries




                                     23
Flexible Layout
First step considered for responsive design is flexible layout. As the browser
width changes, fluid grids will resize and reposition the content as
necessary.




                                    24
Flexible Images and Media
●    Adjusting images according to the different screen widths or devices is
     another important aspect of responsive web design
    img,
    embed,
    video,
    object{
         max-width: 100%;
    }



●    Tutorial fluid image
1. http://unstoppablerobotninja.com/entry/fluid-images/
2. http://www.alistapart.com/articles/fluid-images/


                                         25
Media Queries
●   In CSS2 you was able to apply specific stylesheet for specify media
    type like screen or print.
●   In CSS3, W3C made it more efficient by adding media queries made it
    as part of the CSS3 specification




                                     26
How we use media
    queries?



       27
Media Queries Conditions
/* Landscape phones and down */
@media (max-width: 480px) { ... }

/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }

/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }

/* Large desktop */
@media (min-width: 1200px) { ... }


                                     Source of Twitter Bootstrap



                          28
/* Landscape phones and down */
@media (max-width: 480px) { ... }




                           29
/* Landscape phone to portrait tablet */
  @media (max-width: 767px) { ... }




                           30
/* Portrait tablet to landscape and desktop */
  @media (min-width: 768px) and (max-width: 979px) { ... }




                             31
/* Large desktop */
  @media (min-width: 1200px) { ... }




                           32
Frameworks
   (save time)
       or
Roll Your Own
  (more control)




        33
Framework for
Responsive Web Design


          34
Bootstrap, from Twitter
●   Simple, fluid HTML/CSS/JS framework from Twitter
●   http://twitter.github.com/bootstrap/




                                           35
Foundation
●   The most advanced responsive front-end framework in the world.
●   http://foundation.zurb.com/




                                     36
1140 CSS GRID
●   The 1140 grid fits perfectly into a 1280 monitor...
●   http://cssgrid.net/




                                         37
Other frameworks
●   http://stuffandnonsense.co.uk/projects/320andup/
●   http://framelessgrid.com/
●   http://lessframework.com/
●   http://www.amazium.co.uk/




                                      38
Tips
●    Meta viewport
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />




●    Use css3-mediaqueries.js for IE8 or older
      <!--[if lt IE 9]>

      <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-
      mediaqueries.js"></script>

      <![endif]-->




                                              39
References
●   Responsive Web Design (http://goo.gl/BLQMe)
●   Designing for a Responsive Web (http://goo.gl/iK6dO)
●   Fluid Image (http://goo.gl/RvQlO)
●   More responsive tutorials (http://goo.gl/G75ov)
●   What the hack is Responsive Web Design(http://goo.gl/kUod7)




                                        40
Q&A
       Contact me:
sophy@web-essentials.asia
          @sophy
    http://kooms.info




            41

Mais conteúdo relacionado

Destaque

Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3Shay Howe
 
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
HTML5 Bootcamp: Essential HTML, CSS, & JavaScriptHTML5 Bootcamp: Essential HTML, CSS, & JavaScript
HTML5 Bootcamp: Essential HTML, CSS, & JavaScriptTodd Anglin
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLMayaLisa
 

Destaque (6)

Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3
 
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
HTML5 Bootcamp: Essential HTML, CSS, & JavaScriptHTML5 Bootcamp: Essential HTML, CSS, & JavaScript
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 
Fundamental HTML5
Fundamental HTML5Fundamental HTML5
Fundamental HTML5
 
Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 

Semelhante a Responsive Web Design On Student's day

Responsive web design
Responsive web designResponsive web design
Responsive web designpsophy
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignZoe Gillenwater
 
An Introduction to Responsive Design
An Introduction to Responsive DesignAn Introduction to Responsive Design
An Introduction to Responsive DesignValtech UK
 
Responsive Web Design for Universal Access
Responsive Web Design for Universal AccessResponsive Web Design for Universal Access
Responsive Web Design for Universal AccessKate Walser
 
CSS3: Using media queries to improve the web site experience
CSS3: Using media queries to improve the web site experienceCSS3: Using media queries to improve the web site experience
CSS3: Using media queries to improve the web site experienceZoe Gillenwater
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply ResponsiveDenise Jacobs
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
Responsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 BolognaResponsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 Bolognaalfredo furnò
 
Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13Frédéric Harper
 
Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3Zoe Gillenwater
 
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive UX - One size fits all   @BigDesign conference #BigD12Responsive UX - One size fits all   @BigDesign conference #BigD12
Responsive UX - One size fits all @BigDesign conference #BigD12touchtitans
 
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
 
Advancio, Inc. Academy: Responsive Web Design
Advancio, Inc. Academy: Responsive Web DesignAdvancio, Inc. Academy: Responsive Web Design
Advancio, Inc. Academy: Responsive Web DesignAdvancio
 
Responsive web designing course in Chandigarh
Responsive web designing course in Chandigarh Responsive web designing course in Chandigarh
Responsive web designing course in Chandigarh Big Boxx Animation Academy
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Tirthesh Ganatra
 
Responsive web designing
Responsive web designingResponsive web designing
Responsive web designingAanand Bohara
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media QueriesMan Math
 
Responsive web design
Responsive web designResponsive web design
Responsive web designBen MacNeill
 

Semelhante a Responsive Web Design On Student's day (20)

Responsive web design
Responsive web designResponsive web design
Responsive web design
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
An Introduction to Responsive Design
An Introduction to Responsive DesignAn Introduction to Responsive Design
An Introduction to Responsive Design
 
Responsive Web Design for Universal Access
Responsive Web Design for Universal AccessResponsive Web Design for Universal Access
Responsive Web Design for Universal Access
 
CSS3: Using media queries to improve the web site experience
CSS3: Using media queries to improve the web site experienceCSS3: Using media queries to improve the web site experience
CSS3: Using media queries to improve the web site experience
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Responsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 BolognaResponsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 Bologna
 
Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13
 
Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3
 
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive UX - One size fits all   @BigDesign conference #BigD12Responsive UX - One size fits all   @BigDesign conference #BigD12
Responsive UX - One size fits all @BigDesign conference #BigD12
 
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
 
Advancio, Inc. Academy: Responsive Web Design
Advancio, Inc. Academy: Responsive Web DesignAdvancio, Inc. Academy: Responsive Web Design
Advancio, Inc. Academy: Responsive Web Design
 
Responsive web designing course in Chandigarh
Responsive web designing course in Chandigarh Responsive web designing course in Chandigarh
Responsive web designing course in Chandigarh
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)
 
24 Tips for SITECORE
24 Tips for SITECORE24 Tips for SITECORE
24 Tips for SITECORE
 
Responsive web designing
Responsive web designingResponsive web designing
Responsive web designing
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 

Último

Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
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
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Último (20)

Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
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...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.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)
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Responsive Web Design On Student's day

  • 1. Responsive Web Design by Sophy Prak
  • 2. Sophy Prak Web Developer - Web Essentials Member of KTUG(typo3cambodia.org) Photo: http://goo.gl/Et5Py
  • 3. Introduction ● May 25th, 2010 Ethan Marcotte has wrote article “Responsive Web Design” (http://goo.gl/BLQMe) ● Jun 18, 2010 SIMON COLLISON updated his blog with media queries(colly.com) 3
  • 4. 4
  • 5. Adaptive (Multiple Fixed Width Layouts) or Responsive (Multiple Fluid Grid Layouts) 5
  • 6. Mixed Approach Fixed width for large and medium Fluid width for small 6
  • 7. Why do we use Responsive Web Design? 7
  • 8. Should we create sub-domain and design layout for each devices? 8
  • 9. 9
  • 10. 10
  • 11. 11
  • 12. 12
  • 14. “Day by day, the number of devices, platforms, and browsers that need to work with your site grows. Responsive web design represents a fundamental shift in how we’ll build websites for the decade to come.” - Jeffrey Veen 14
  • 15. “Responsive design will become even better as we get tools, like Flexible Box and the Grid Layout spec” - Eric Meyer 15
  • 16. One site for every screen - John Polacek 16
  • 17. Who is using it? 17
  • 22. Other sites ● http://css-tricks.com/ ● http://webdesignerwall.com/ ● For more http://mediaqueri.es/ 22
  • 23. Responsive Web Design ● Key Elements of Responsive Web Design ● Flexible Layout ● Flexible Images and Media ● Media Queries 23
  • 24. Flexible Layout First step considered for responsive design is flexible layout. As the browser width changes, fluid grids will resize and reposition the content as necessary. 24
  • 25. Flexible Images and Media ● Adjusting images according to the different screen widths or devices is another important aspect of responsive web design img, embed, video, object{ max-width: 100%; } ● Tutorial fluid image 1. http://unstoppablerobotninja.com/entry/fluid-images/ 2. http://www.alistapart.com/articles/fluid-images/ 25
  • 26. Media Queries ● In CSS2 you was able to apply specific stylesheet for specify media type like screen or print. ● In CSS3, W3C made it more efficient by adding media queries made it as part of the CSS3 specification 26
  • 27. How we use media queries? 27
  • 28. Media Queries Conditions /* Landscape phones and down */ @media (max-width: 480px) { ... } /* Landscape phone to portrait tablet */ @media (max-width: 767px) { ... } /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { ... } /* Large desktop */ @media (min-width: 1200px) { ... } Source of Twitter Bootstrap 28
  • 29. /* Landscape phones and down */ @media (max-width: 480px) { ... } 29
  • 30. /* Landscape phone to portrait tablet */ @media (max-width: 767px) { ... } 30
  • 31. /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { ... } 31
  • 32. /* Large desktop */ @media (min-width: 1200px) { ... } 32
  • 33. Frameworks (save time) or Roll Your Own (more control) 33
  • 35. Bootstrap, from Twitter ● Simple, fluid HTML/CSS/JS framework from Twitter ● http://twitter.github.com/bootstrap/ 35
  • 36. Foundation ● The most advanced responsive front-end framework in the world. ● http://foundation.zurb.com/ 36
  • 37. 1140 CSS GRID ● The 1140 grid fits perfectly into a 1280 monitor... ● http://cssgrid.net/ 37
  • 38. Other frameworks ● http://stuffandnonsense.co.uk/projects/320andup/ ● http://framelessgrid.com/ ● http://lessframework.com/ ● http://www.amazium.co.uk/ 38
  • 39. Tips ● Meta viewport <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /> ● Use css3-mediaqueries.js for IE8 or older <!--[if lt IE 9]> <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3- mediaqueries.js"></script> <![endif]--> 39
  • 40. References ● Responsive Web Design (http://goo.gl/BLQMe) ● Designing for a Responsive Web (http://goo.gl/iK6dO) ● Fluid Image (http://goo.gl/RvQlO) ● More responsive tutorials (http://goo.gl/G75ov) ● What the hack is Responsive Web Design(http://goo.gl/kUod7) 40
  • 41. Q&A Contact me: sophy@web-essentials.asia @sophy http://kooms.info 41