SlideShare ist ein Scribd-Unternehmen logo
1 von 44
CSS Media Queries
Web and Django Developer
Seneca College Prof
Boulevard Platform Founder

Tom Aratyn
tom@aratyn.name
Today
        • HTML/CSS Refresher
        • What are CSS Media
          Queries
        • What is Responsive
          Design
        • Understanding Media
        • Understanding Screens
        • Demos + Resources
Welcome!
Let’s go round the
room




           What’s your heart’s desire?
• Not
What we’re doing…        – Comprehensive and
… and what we’re not       detailed course on CSS
                           Media Queries and
                           Responsive Designed
                       • Are
                         – Give you the basic tools
                           to hack and continue
                           learning
                         – I’ll be around to help out
                           and give advice!
                         – There are also other
                           awesome people in the
                           room! They’ll help too!
HTML/CSS Tutorial/Refresher
What is HTML?
                             <title>
  <head> holds
  ―metadata‖
                    <head>
                             <style>

       <html>                 <h1>

                             <div>     <p>
<body> holds data   <body>
(read content)
                                       <li>

                              <ul>     <li>

                                       <li>
Division of Responsibilities
HTML: Structure
CSS: Style
JavaScript: Interaction
Self Closing HTML
       Tags




                <br>
                <hr>
Regular HTML Tags




   <p></p>
 <div></div>
<html></html>
Define the style of elements (read: tags)

What is CSS?
Styles ―cascade‖ (read: apply on to each other)
     Rules are applied based on:
     • priority (read: specificity)
     • order




Why Cascading?
• Semantic Tags
   • <header>
   • Not
     <div
     class=―header‖>
   • <article>
   • Not
     <div
     class=―blogpost‖>


• Also
  <video>, <audio>, a
  nd <canvas>
   • Not Flash
What are CSS Media
                  Queries?



Lets us ―style‖ our content
―right‖ depending on the
 media it’s displayed on.

       Goodnight!
What kind of media
   are there?
90’s
2000-2006
2007-Now
Interface (Click Vs. Touch)
Screen Size
Bandwidth

Some Major Concerns of
Multi-Device Design
Lets us ―style‖ our content ―right‖
no matter which media it is being
displayed on.
What are CSS Media Queries?
http://mediaqueri.es/



Responsive Web Design
Screenshot of http://mediaqueri.es
―In recent years, I’ve been
The Problem    meeting with more companies
               that request ―an iPhone
               website‖ as part of their

 Ethan         project…But what’s next? An
               iPad website? An N90
               website? Can we really
Marotte        continue to commit to
               supporting each new user
               agent with its own bespoke
     on        experience? At some point,
               this starts to feel like a zero
A List Apart   sum game. But how can we—
                                    ‖
               and our designs—adapt?
The(?) Solution

Responsive
Design     • Fluid Grids
                    – Relative Sizes
                  • Media Queries
                    – Style based on
                      resolution
                  • http://www.alistapart.com/d/r
                    esponsive-web-design/ex/ex-
                    site-FINAL.html
Criticism?
It’s multiple designs




              The different sized assets,
            content elimination decisions
             mean that you’re basically
           doing multiple designs anyway
Can Be Data
                Intensive




Does everyone download
     all the designs?
Defeat User
Expectations




       ―One of the biggest bugbears I have with
        responsive design relates to when I am
      used to a particular desktop design, only to
           find that the responsive design is
                 completely different.‖
Desktop Designs Are
  Good Enough




                Goldplating
Other Design
                  Approaches




• Mobile First
• Progressive Enhancement
  •   Modernizr
$0.02




•   Offering a way back to the
    desktop design may make
    sense.
•   User expectations are in flux –
    few clear idioms yet.
Media Types in the             Braille         Embossed
        Spec
http://www.w3.org/TR/CSS21/m
edia.html
                               Handheld            Print




                               Projection         Screen




                                Speech             Tty




                                            TV
Media Types I’ve Seen
Unfortunately I haven’t media
types that are related to
accessibility.                   Print




                                Screen
Different types of
     Screens
What’s In A
                (Mobile) Pixel?



<meta name="viewport"
content="width=320">
<meta name="viewport"
      content="width=device-width‖>
Pixel Density
                  Media Query




(webkit-min-device-pixel-
ratio: 2)
(min-resolution: 2ddpx)
Based On Twitter
Bootstrap           Phone       < 767 PX

What
resolution is
on what
                   Tablets    768px – 978 PX
device?


                   Desktops     > 979 PX
Resources
• What browser supports what?
  – http://caniuse.com
• Responsive Layout Patterns
  – http://www.lukew.com/ff/entry.asp?1514
• Initial Responsive Design Article
  – http://www.alistapart.com/articles/respon
    sive-web-design/
Tools
• Twitter Bootstrap
  – Has a lot of features
  – Includes responsive design helpers
  – http://twitter.github.com/bootstrap/index
    .html
• Zurb Foundation 3
  – Specifically a Responsive CSS Framework
  – http://foundation.zurb.com/
• Firefox Responsive Design View
Thank You!

 Questions?
Brainstorming
Project Ideas?

Weitere ähnliche Inhalte

Was ist angesagt?

Build Accessibly - Community Day 2012
Build Accessibly - Community Day 2012Build Accessibly - Community Day 2012
Build Accessibly - Community Day 2012Karen Mardahl
 
Responsive Development (ZendCon 2012)
Responsive Development (ZendCon 2012)Responsive Development (ZendCon 2012)
Responsive Development (ZendCon 2012)Kevin Bruce
 
Hammersmith fundamentals html fundamentals
Hammersmith fundamentals   html fundamentalsHammersmith fundamentals   html fundamentals
Hammersmith fundamentals html fundamentalsMike Bradshaw
 
Newbies, you are not alone
Newbies, you are not aloneNewbies, you are not alone
Newbies, you are not aloneBrandon Dove
 
How the Wordpress CMS Really Works
How the Wordpress CMS Really WorksHow the Wordpress CMS Really Works
How the Wordpress CMS Really WorksHandsOnWP.com
 
Putting together a web app
Putting together a web appPutting together a web app
Putting together a web appRyan Lou
 
How WordPress Themes Work
How WordPress Themes WorkHow WordPress Themes Work
How WordPress Themes WorkHandsOnWP.com
 
Drupal UI Tweaks PNW Drupal Summit
Drupal UI Tweaks PNW Drupal SummitDrupal UI Tweaks PNW Drupal Summit
Drupal UI Tweaks PNW Drupal SummitDarkoDev
 
Accessibility is not disability Drupal South 2014
Accessibility is not disability Drupal South 2014Accessibility is not disability Drupal South 2014
Accessibility is not disability Drupal South 2014Gareth Hall
 
Intermediate Dreamweaver (2007)
Intermediate Dreamweaver (2007)Intermediate Dreamweaver (2007)
Intermediate Dreamweaver (2007)Matteo Wyllyamz
 

Was ist angesagt? (16)

Build Accessibly - Community Day 2012
Build Accessibly - Community Day 2012Build Accessibly - Community Day 2012
Build Accessibly - Community Day 2012
 
Responsive Development (ZendCon 2012)
Responsive Development (ZendCon 2012)Responsive Development (ZendCon 2012)
Responsive Development (ZendCon 2012)
 
Hammersmith fundamentals html fundamentals
Hammersmith fundamentals   html fundamentalsHammersmith fundamentals   html fundamentals
Hammersmith fundamentals html fundamentals
 
Newbies, you are not alone
Newbies, you are not aloneNewbies, you are not alone
Newbies, you are not alone
 
How the Wordpress CMS Really Works
How the Wordpress CMS Really WorksHow the Wordpress CMS Really Works
How the Wordpress CMS Really Works
 
Putting together a web app
Putting together a web appPutting together a web app
Putting together a web app
 
jQuery for Drupal
jQuery for DrupaljQuery for Drupal
jQuery for Drupal
 
How WordPress Themes Work
How WordPress Themes WorkHow WordPress Themes Work
How WordPress Themes Work
 
Catch the Eye: Tips for a Clean WebSite
Catch the Eye: Tips for a Clean WebSiteCatch the Eye: Tips for a Clean WebSite
Catch the Eye: Tips for a Clean WebSite
 
Drupal UI Tweaks PNW Drupal Summit
Drupal UI Tweaks PNW Drupal SummitDrupal UI Tweaks PNW Drupal Summit
Drupal UI Tweaks PNW Drupal Summit
 
Accessibility is not disability Drupal South 2014
Accessibility is not disability Drupal South 2014Accessibility is not disability Drupal South 2014
Accessibility is not disability Drupal South 2014
 
Drupal intro
Drupal introDrupal intro
Drupal intro
 
Drupal intro
Drupal introDrupal intro
Drupal intro
 
Web_Accessibility
Web_AccessibilityWeb_Accessibility
Web_Accessibility
 
Intermediate Dreamweaver (2007)
Intermediate Dreamweaver (2007)Intermediate Dreamweaver (2007)
Intermediate Dreamweaver (2007)
 
jQuery for Drupal
jQuery for DrupaljQuery for Drupal
jQuery for Drupal
 

Andere mochten auch

Andere mochten auch (16)

Class feedback
Class feedbackClass feedback
Class feedback
 
Tics power
Tics powerTics power
Tics power
 
Presentacion Microscopios (Daniel Aguilar)
Presentacion Microscopios (Daniel Aguilar)Presentacion Microscopios (Daniel Aguilar)
Presentacion Microscopios (Daniel Aguilar)
 
Tics power
Tics powerTics power
Tics power
 
the value of Fire Fox Design
the value of Fire Fox Designthe value of Fire Fox Design
the value of Fire Fox Design
 
Movies seen by hearts
Movies seen by heartsMovies seen by hearts
Movies seen by hearts
 
áLbum de fotografías
áLbum de fotografíasáLbum de fotografías
áLbum de fotografías
 
Smm продвижение
Smm продвижениеSmm продвижение
Smm продвижение
 
Soy uniatlanticense
Soy uniatlanticense Soy uniatlanticense
Soy uniatlanticense
 
Nasrat
NasratNasrat
Nasrat
 
dr Mitar Lutovac prezentacija
dr Mitar Lutovac prezentacijadr Mitar Lutovac prezentacija
dr Mitar Lutovac prezentacija
 
Dr mitar lutovac ekoturizam
Dr mitar lutovac ekoturizamDr mitar lutovac ekoturizam
Dr mitar lutovac ekoturizam
 
Menulis Puisi
Menulis PuisiMenulis Puisi
Menulis Puisi
 
Proposal dan unsur-Unsurnya:
Proposal dan unsur-Unsurnya:Proposal dan unsur-Unsurnya:
Proposal dan unsur-Unsurnya:
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
La sociedad en red
La sociedad en redLa sociedad en red
La sociedad en red
 

Ähnlich wie Mozilla Developer Derby October 2012: Media Queries

Responsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparisonResponsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparisonDhrubaJyoti Dey
 
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 2013Marc D Anderson
 
Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Frédéric Harper
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the maxNeil Perlin
 
Leverage Your Online Web Presence
Leverage Your Online Web PresenceLeverage Your Online Web Presence
Leverage Your Online Web PresenceSusan Boone
 
Web designtrends 5-29-2013
Web designtrends 5-29-2013Web designtrends 5-29-2013
Web designtrends 5-29-2013Angela Bowman
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practicesmintersam
 
Everything Old is New Again: The State of Web Design
Everything Old is New Again: The State of Web DesignEverything Old is New Again: The State of Web Design
Everything Old is New Again: The State of Web DesignMaria D'Amato
 
Developing for the unknown lavacon
Developing for the unknown   lavaconDeveloping for the unknown   lavacon
Developing for the unknown lavaconNeil Perlin
 
Developing for the unknown lavacon
Developing for the unknown   lavaconDeveloping for the unknown   lavacon
Developing for the unknown lavaconNeil Perlin
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issuesNeil Perlin
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screenFour Kitchens
 
Responsive Web Design_2013
Responsive Web Design_2013Responsive Web Design_2013
Responsive Web Design_2013Achieve Internet
 
Designing (Deciding) in the Browser
Designing (Deciding) in the BrowserDesigning (Deciding) in the Browser
Designing (Deciding) in the BrowserSang-Min Yoon
 
Responsive Design for SharePoint
Responsive Design for SharePointResponsive Design for SharePoint
Responsive Design for SharePointCathy Dew
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignIntroduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignipmindthegap
 
UX-Driven & Inclusive Data Visualizations
UX-Driven & Inclusive Data VisualizationsUX-Driven & Inclusive Data Visualizations
UX-Driven & Inclusive Data VisualizationsMichelle Michael
 
FITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web DesignFITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web DesignFrédéric Harper
 

Ähnlich wie Mozilla Developer Derby October 2012: Media Queries (20)

Responsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparisonResponsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparison
 
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
 
Designing for Everybody Workshop
Designing for Everybody WorkshopDesigning for Everybody Workshop
Designing for Everybody Workshop
 
Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the max
 
Leverage Your Online Web Presence
Leverage Your Online Web PresenceLeverage Your Online Web Presence
Leverage Your Online Web Presence
 
Web designtrends 5-29-2013
Web designtrends 5-29-2013Web designtrends 5-29-2013
Web designtrends 5-29-2013
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Everything Old is New Again: The State of Web Design
Everything Old is New Again: The State of Web DesignEverything Old is New Again: The State of Web Design
Everything Old is New Again: The State of Web Design
 
Developing for the unknown lavacon
Developing for the unknown   lavaconDeveloping for the unknown   lavacon
Developing for the unknown lavacon
 
Developing for the unknown lavacon
Developing for the unknown   lavaconDeveloping for the unknown   lavacon
Developing for the unknown lavacon
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issues
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screen
 
Responsive Web Design_2013
Responsive Web Design_2013Responsive Web Design_2013
Responsive Web Design_2013
 
Designing (Deciding) in the Browser
Designing (Deciding) in the BrowserDesigning (Deciding) in the Browser
Designing (Deciding) in the Browser
 
Responsive Design for SharePoint
Responsive Design for SharePointResponsive Design for SharePoint
Responsive Design for SharePoint
 
Responsive Design and Joomla!
Responsive Design and Joomla!Responsive Design and Joomla!
Responsive Design and Joomla!
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignIntroduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesign
 
UX-Driven & Inclusive Data Visualizations
UX-Driven & Inclusive Data VisualizationsUX-Driven & Inclusive Data Visualizations
UX-Driven & Inclusive Data Visualizations
 
FITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web DesignFITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web Design
 

Mozilla Developer Derby October 2012: Media Queries

  • 2. Web and Django Developer Seneca College Prof Boulevard Platform Founder Tom Aratyn tom@aratyn.name
  • 3. Today • HTML/CSS Refresher • What are CSS Media Queries • What is Responsive Design • Understanding Media • Understanding Screens • Demos + Resources
  • 4. Welcome! Let’s go round the room What’s your heart’s desire?
  • 5. • Not What we’re doing… – Comprehensive and … and what we’re not detailed course on CSS Media Queries and Responsive Designed • Are – Give you the basic tools to hack and continue learning – I’ll be around to help out and give advice! – There are also other awesome people in the room! They’ll help too!
  • 7. What is HTML? <title> <head> holds ―metadata‖ <head> <style> <html> <h1> <div> <p> <body> holds data <body> (read content) <li> <ul> <li> <li>
  • 12. Self Closing HTML Tags <br> <hr>
  • 13. Regular HTML Tags <p></p> <div></div> <html></html>
  • 14. Define the style of elements (read: tags) What is CSS?
  • 15. Styles ―cascade‖ (read: apply on to each other) Rules are applied based on: • priority (read: specificity) • order Why Cascading?
  • 16. • Semantic Tags • <header> • Not <div class=―header‖> • <article> • Not <div class=―blogpost‖> • Also <video>, <audio>, a nd <canvas> • Not Flash
  • 17. What are CSS Media Queries? Lets us ―style‖ our content ―right‖ depending on the media it’s displayed on. Goodnight!
  • 18. What kind of media are there?
  • 22. Interface (Click Vs. Touch) Screen Size Bandwidth Some Major Concerns of Multi-Device Design
  • 23. Lets us ―style‖ our content ―right‖ no matter which media it is being displayed on. What are CSS Media Queries?
  • 26. ―In recent years, I’ve been The Problem meeting with more companies that request ―an iPhone website‖ as part of their Ethan project…But what’s next? An iPad website? An N90 website? Can we really Marotte continue to commit to supporting each new user agent with its own bespoke on experience? At some point, this starts to feel like a zero A List Apart sum game. But how can we— ‖ and our designs—adapt?
  • 27. The(?) Solution Responsive Design • Fluid Grids – Relative Sizes • Media Queries – Style based on resolution • http://www.alistapart.com/d/r esponsive-web-design/ex/ex- site-FINAL.html
  • 29. It’s multiple designs The different sized assets, content elimination decisions mean that you’re basically doing multiple designs anyway
  • 30. Can Be Data Intensive Does everyone download all the designs?
  • 31. Defeat User Expectations ―One of the biggest bugbears I have with responsive design relates to when I am used to a particular desktop design, only to find that the responsive design is completely different.‖
  • 32. Desktop Designs Are Good Enough Goldplating
  • 33. Other Design Approaches • Mobile First • Progressive Enhancement • Modernizr
  • 34. $0.02 • Offering a way back to the desktop design may make sense. • User expectations are in flux – few clear idioms yet.
  • 35. Media Types in the Braille Embossed Spec http://www.w3.org/TR/CSS21/m edia.html Handheld Print Projection Screen Speech Tty TV
  • 36. Media Types I’ve Seen Unfortunately I haven’t media types that are related to accessibility. Print Screen
  • 38. What’s In A (Mobile) Pixel? <meta name="viewport" content="width=320"> <meta name="viewport" content="width=device-width‖>
  • 39. Pixel Density Media Query (webkit-min-device-pixel- ratio: 2) (min-resolution: 2ddpx)
  • 40. Based On Twitter Bootstrap Phone < 767 PX What resolution is on what Tablets 768px – 978 PX device? Desktops > 979 PX
  • 41. Resources • What browser supports what? – http://caniuse.com • Responsive Layout Patterns – http://www.lukew.com/ff/entry.asp?1514 • Initial Responsive Design Article – http://www.alistapart.com/articles/respon sive-web-design/
  • 42. Tools • Twitter Bootstrap – Has a lot of features – Includes responsive design helpers – http://twitter.github.com/bootstrap/index .html • Zurb Foundation 3 – Specifically a Responsive CSS Framework – http://foundation.zurb.com/ • Firefox Responsive Design View

Hinweis der Redaktion

  1. Empty.
  2. http://en.wikipedia.org/wiki/File:Airbus_A380_cockpit.jpg
  3. See cascading-example.html
  4. http://en.wikipedia.org/wiki/File:The_Time_Machine_Classics_Illustrated_133.jpg
  5. http://en.wikipedia.org/w/index.php?title=File:Symbian_logo_4.svg&amp;page=1http://en.wikipedia.org/wiki/File:PalmPilot5000.jpghttp://www.flickr.com/photos/juniorvelo/1455787847/sizes/z/in/photostream/http://en.wikipedia.org/wiki/File:Refreshable_Braille_display.jpghttp://en.wikipedia.org/wiki/File:Netscape_classic_logo.pnghttp://blogs.msdn.com/b/ie/archive/2010/09/16/internet-explorer-9-logo-visual-refresh.aspx
  6. Blackberries!
  7. Index.html
  8. http://www.alistapart.com/articles/responsive-web-design/
  9. Needs Cost Benefit Analysis
  10. Need to be careful how you structure your document
  11. Menu’s at the bottom
  12. Let’s see some code:Index.html
  13. http://en.wikipedia.org/w/index.php?title=File:Vector_Video_Standards4.svgCode samples1. Html-5asside
  14. Html5-ad.html