SlideShare a Scribd company logo
Responsive web standards?




                             Chris Mills
                        Opera Software/W3C

Friday, 7 December 12
Who am I?


          *        Works for Opera and W3C
          *        Open standards evangelist
          *        HTML5/CSS3 wrangler
          *        Accessibility whinger
          *        Education agitator
          *        Heavy metal drummer



Responsive web standards?                      Chris Mills
Friday, 7 December 12
Useful stuff

                                @chrisdavidmills
                        cmills@opera.com/cmills@w3.org
                         slideshare.net/chrisdavidmills
                                webplatform.org
                                 dev.opera.com




Friday, 7 December 12
A question




          Do web standards provide a good set of
          tools for responsive web design?




Responsive web standards?                    Chris Mills
Friday, 7 December 12
The answer




          We’re getting there ;-)




Responsive web standards?            Chris Mills
Friday, 7 December 12
But the road has been hard




Friday, 7 December 12
CSS first existed circa 1996




Responsive web standards?                         Chris Mills
Friday, 7 December 12
But ... browser support?
          <table width="100%" style="height: 100%;" cellpadding="10" cellspacing="0"
          border="0">
          <tr>
          <!-- ============ HEADER SECTION ============== -->
          <td colspan="2" style="height: 100px;" bgcolor="#777d6a"><h1>Website
          Logo</h1></td></tr>

          <tr>
          <!-- ============ LEFT COLUMN (MENU) ============== -->
          <td width="20%" valign="top" bgcolor="#999f8e">
          <a href="#">Menu link</a><br>
          <a href="#">Menu link</a><br>
          <a href="#">Menu link</a><br>
          <a href="#">Menu link</a><br>
          <a href="#">Menu link</a>
          </td>

Responsive web standards?                                                   Chris Mills
Friday, 7 December 12
CSS 1 and 2 had very few...


          ...RWD-friendly features


          Because RWD problems didn’t exist back
          then!




Responsive web standards?                         Chris Mills
Friday, 7 December 12
Layout tools?


          Then again CSS2 has few layout tools ...


          Period.




Responsive web standards?                     Chris Mills
Friday, 7 December 12
We still abuse floats and padding


          And positioning is good.


          But doesn’t solve everything.




Responsive web standards?                 Chris Mills
Friday, 7 December 12
CSS2 has media types


          But they are largely flawed
          media=”screen”, media=”print”
          media=”handheld”, media=”tv”
          media=”wtf?”




Responsive web standards?                      Chris Mills
Friday, 7 December 12
Surely they are all really “screen”?




Friday, 7 December 12
<img> was never responsive




          We had no need for responsive images
          when <img> was created




Responsive web standards?                        Chris Mills
Friday, 7 December 12
And we’ve never had...

          *        “Proper” layout modules
          *        Feature detection
          *        Access to hardware features
          *        whinge whinge whinge...
          *        ...I want it all yesterday...
          *        ...etc.




Responsive web standards?                          Chris Mills
Friday, 7 December 12
Whinge over




Responsive web standards?             Chris Mills
Friday, 7 December 12
The W3C process is long




Responsive web standards?                         Chris Mills
Friday, 7 December 12
The W3C process is long


          *        A problem first has to present itself
          *        Someone has to propose a solution
          *        Which has to be agreed by committee
          *        After checking for the “P” word
          *        And then implemented by browsers
          *        And then adopted by developers



Responsive web standards?                            Chris Mills
Friday, 7 December 12
Media queries succeed...




          ...where media types failed




Responsive web standards?                          Chris Mills
Friday, 7 December 12
Media queries


          media="screen and (max-width: 481px)"


          @media screen and (max-width: 481px) {
            /* do amazing stuff for
              narrow screens */
          }



Responsive web standards?                     Chris Mills
Friday, 7 December 12
Media queries




Responsive web standards?               Chris Mills
Friday, 7 December 12
Viewport is also necessary




          For making mobile browsers behave!




Responsive web standards?                        Chris Mills
Friday, 7 December 12
Viewport is also necessary




Responsive web standards?                        Chris Mills
Friday, 7 December 12
Viewport is also necessary




          <meta name="viewport"
          content="width=device-width">




Responsive web standards?                        Chris Mills
Friday, 7 December 12
CSS device adaptation spec




          Does viewport stuff ... in CSS




Responsive web standards?                        Chris Mills
Friday, 7 December 12
CSS device adaptation spec
          <meta name="viewport"
           content="width=550,
           maximum-scale=1.0,
           target-densitydpi=device-dpi">


          @viewport {
            width: 550px;
            max-zoom: 1;
            resolution: device;
          }

Responsive web standards?                        Chris Mills
Friday, 7 December 12
CSS4 media queries


          *        script
          *        hover
          *        pointer (none/coarse/fine)
          *        luminosity (dim/normal/washed)




Responsive web standards?                           Chris Mills
Friday, 7 December 12
Other media query ideas


          *        paged
          *        interactive
          *         touch
          *        keyboard
          *        remote
          *        network-speed



Responsive web standards?                         Chris Mills
Friday, 7 December 12
CSS3 features “proper” layout


          *        Flexbox
          *        Multi-col layout
          *        Grids
          *        Regions
          *        Exclusions and shapes
          *        GCPM



Responsive web standards?                  Chris Mills
Friday, 7 December 12
Example: Flexbox


          *        Easier UI layout
          *        Makes layout tasks much easier
          *        Cross browser support getting there
          *        Great for mobile UIs




Responsive web standards?                          Chris Mills
Friday, 7 December 12
Example: Flexbox


          <section>
           <article id="first"></article>
           <article id="second"></article>
           <article id="third"></article>
          </section>




Responsive web standards?                    Chris Mills
Friday, 7 December 12
Responsive web standards?   Chris Mills
Friday, 7 December 12
Example: Flexbox

          section {
            display: flex;
            flex-flow: row;
          }


          section {
            display: flex;
            flex-flow: column;
          }
Responsive web standards?                  Chris Mills
Friday, 7 December 12
Responsive web standards?   Chris Mills
Friday, 7 December 12
Example: Flexbox


          section {
            display: flex;
            flex-flow: row;
            align-items: center;
          }




Responsive web standards?                  Chris Mills
Friday, 7 December 12
Responsive web standards?   Chris Mills
Friday, 7 December 12
Example: Flexbox


          #first, #third {
            order: 2;
          }


          #second {
            order: 1;
          }

Responsive web standards?                  Chris Mills
Friday, 7 December 12
Responsive web standards?   Chris Mills
Friday, 7 December 12
Example: Flexbox
          #first {
            flex: 1;
          }


          #second {
            flex: 1;
          }


          #third {
            flex: 1;
          }
Responsive web standards?                  Chris Mills
Friday, 7 December 12
Responsive web standards?   Chris Mills
Friday, 7 December 12
Example: Flexbox
          #first {
            flex: 1;
          }


          #second {
            flex: 1;
          }


          #third {
            flex: 2;
          }
Responsive web standards?                  Chris Mills
Friday, 7 December 12
Responsive web standards?   Chris Mills
Friday, 7 December 12
Responsive replaced elements

          * max-width: 100% ...
          * HTML5 <video>: <source> media
          attributes
          * <picture>




Responsive web standards?                         Chris Mills
Friday, 7 December 12
HTML5 <video>


          <source src="crystal320.webm"
          type="video/webm" media="all and (max-
          width: 480px)">
             <source src="crystal720.webm"
          type="video/webm" media="all and (min-
          width: 481px)">



Responsive web standards?                    Chris Mills
Friday, 7 December 12
The <picture> element

          <picture alt="a picture of something">
           <source src="mobile.jpg">
           <source src="medium.jpg" media="min-
                  width: 600px">
           <source src="fullsize.jpg" media="min-
                  width: 900px">
           <img src="mobile.jpg">
           <!-- fallback for
                non-supporting browsers -->
          </picture>
Responsive web standards?                           Chris Mills
Friday, 7 December 12
Other useful image features


          * object-fit / object-position
          * background-image:
          image('image.png#xywh=150,250,100,100');
          * background-image: image("wavy.svg",
          'wavy.png' , "wavy.gif");




Responsive web standards?                        Chris Mills
Friday, 7 December 12
object-fit/object-position


          img {
            width: 300px;
            height: 300px;
            ...
            object-fit: contain;
          }




Responsive web standards?                        Chris Mills
Friday, 7 December 12
Image fragments




          background-image:
          image('image.png#xywh=15,30,150,120');

Responsive web standards?                          Chris Mills
Friday, 7 December 12
Misc responsive features


          * matchMedia
          * Native feature detection with
          @supports
          * CSS3 web fonts for icons
          * unicode-range




Responsive web standards?                          Chris Mills
Friday, 7 December 12
matchMedia


          if (window.matchMedia("(min-width:
          400px)").matches) {
            /* Do stuff for wider screens */
          } else {
            /* Do stuff for narrow screens */
          }




Responsive web standards?                       Chris Mills
Friday, 7 December 12
@supports


          @supports (display:flex) {
            section { display: flex }
            ...
          }




Responsive web standards?               Chris Mills
Friday, 7 December 12
unicode-range


          @font-face {
            font-family: myFont;
            src: local(myFont), url(/fonts/myFont.otf);
            unicode-range: U+000-49F, U+2000-27FF;
          }




Responsive web standards?                           Chris Mills
Friday, 7 December 12
Thanks!

                                @chrisdavidmills
                        cmills@opera.com/cmills@w3.org
                         slideshare.net/chrisdavidmills
                                webplatform.org
                                 dev.opera.com




Friday, 7 December 12

More Related Content

PDF
"What is left to do?", Dublin Core 2012 Keynote
PDF
KEY
Drupaling a Devleopment Plan
TXT
Pleosc ar-odontoblast
PDF
KEEP ON TECH XenDesktop 7
PDF
Kundeservice i sosiale medier. Fem innspill. Christian Brosstad
PDF
An employer's perspective on teaching essential employability skills
PPT
Marco Mc Expectativas De Ventas En Ti En 2010 2
"What is left to do?", Dublin Core 2012 Keynote
Drupaling a Devleopment Plan
Pleosc ar-odontoblast
KEEP ON TECH XenDesktop 7
Kundeservice i sosiale medier. Fem innspill. Christian Brosstad
An employer's perspective on teaching essential employability skills
Marco Mc Expectativas De Ventas En Ti En 2010 2

Viewers also liked (20)

DOC
Traduccion de Synchronous e-Learning, The elearning GUILD
DOCX
Pico y sex. erotismo
DOCX
Actividad1y2.aguilar manriquezmariacristinacomunicacion
PPT
Bartolomé de las Casas haridian cathaysa marlene y tamara
PDF
18 educational models for use the DIGITAL WHITEBOARD (DWB)
DOC
Los monstruos locos.
PDF
Jornadas Conmemorativas del 700 aniversario de la Sinagoga de Córdoba
PDF
Tesis perfil lipídico de cuyes en crecimiento en el cere pampa del arco aya...
PDF
German vocabulary list
PPT
Catalogo
PDF
53º Cometa Cena
PDF
Presentación catálogo volare
DOCX
How to Guide Innovation in a Changing Education Ecosystem?
PDF
Gerber Life Insurance Advertising Analytics - EverydayFamily.com
PDF
Objetivos y opciones, Jacobo Pastor García Villarreal
PPT
Suresh chandra ebusiness
PPTX
Lmc fuck yeah (19 diapositives)
PPTX
Clase 5 quim. inorganica cualitativa
PPTX
Proyecto final 102058_219_ (3)
Traduccion de Synchronous e-Learning, The elearning GUILD
Pico y sex. erotismo
Actividad1y2.aguilar manriquezmariacristinacomunicacion
Bartolomé de las Casas haridian cathaysa marlene y tamara
18 educational models for use the DIGITAL WHITEBOARD (DWB)
Los monstruos locos.
Jornadas Conmemorativas del 700 aniversario de la Sinagoga de Córdoba
Tesis perfil lipídico de cuyes en crecimiento en el cere pampa del arco aya...
German vocabulary list
Catalogo
53º Cometa Cena
Presentación catálogo volare
How to Guide Innovation in a Changing Education Ecosystem?
Gerber Life Insurance Advertising Analytics - EverydayFamily.com
Objetivos y opciones, Jacobo Pastor García Villarreal
Suresh chandra ebusiness
Lmc fuck yeah (19 diapositives)
Clase 5 quim. inorganica cualitativa
Proyecto final 102058_219_ (3)
Ad

Similar to Responsive web design standards? (20)

PDF
Responsive Web Design &amp; Workflow
PDF
Web Performance & You
PDF
Keeping responsive into the future by Chris mills
PDF
Adapt and respond: keeping responsive into the future
PPTX
Responsive & Adaptive Web Design
PDF
Performance & Responsive Web Design
PDF
HTML5 and Sencha Touch
PDF
NCDevCon2012_designing the mobile experience
PDF
Responsive Web Design: Clever Tips and Techniques
PDF
05 Mobile CSS
PDF
Responsive Web Design
PDF
Environmental Design Vol. 2
PDF
7 common problems with salesforce data migration
PDF
Responsive Web Design & the state of the Web
PDF
Responsive widget-design-with-word press
PDF
Keys to Responsive Design
PDF
Cloud4all Architecture Overview
PDF
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
PPTX
Responsive Web Design - What You Need to Know to Get Started
PDF
Is everything we used to do wrong?
Responsive Web Design &amp; Workflow
Web Performance & You
Keeping responsive into the future by Chris mills
Adapt and respond: keeping responsive into the future
Responsive & Adaptive Web Design
Performance & Responsive Web Design
HTML5 and Sencha Touch
NCDevCon2012_designing the mobile experience
Responsive Web Design: Clever Tips and Techniques
05 Mobile CSS
Responsive Web Design
Environmental Design Vol. 2
7 common problems with salesforce data migration
Responsive Web Design & the state of the Web
Responsive widget-design-with-word press
Keys to Responsive Design
Cloud4all Architecture Overview
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
Responsive Web Design - What You Need to Know to Get Started
Is everything we used to do wrong?
Ad

More from Chris Mills (20)

PDF
More efficient, usable web
PDF
Feedback handling, community wrangling, panhandlin’
PDF
APIs for modern web apps
PDF
APIs, now and in the future
PDF
Guerrilla education
PDF
Web versus Native: round 1!
PDF
BrazilJS MDN
PDF
Empowering the "mobile web"
PDF
Documentation and publishing
PDF
MDN is easy!
PDF
Getting rid of images with CSS
PDF
Future layouts
PDF
Laying out the future
PDF
Accessibility doesn't exist
PDF
Adapt! Media queries and viewport
KEY
Angels versus demons: balancing shiny and inclusive
PDF
HTML5 and CSS3: does now really mean now?
PDF
The W3C and the web design ecosystem
PDF
HTML5 Pearson preso
PDF
Brave new world of HTML5
More efficient, usable web
Feedback handling, community wrangling, panhandlin’
APIs for modern web apps
APIs, now and in the future
Guerrilla education
Web versus Native: round 1!
BrazilJS MDN
Empowering the "mobile web"
Documentation and publishing
MDN is easy!
Getting rid of images with CSS
Future layouts
Laying out the future
Accessibility doesn't exist
Adapt! Media queries and viewport
Angels versus demons: balancing shiny and inclusive
HTML5 and CSS3: does now really mean now?
The W3C and the web design ecosystem
HTML5 Pearson preso
Brave new world of HTML5

Recently uploaded (20)

PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Programs and apps: productivity, graphics, security and other tools
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Diabetes mellitus diagnosis method based random forest with bat algorithm
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release

Responsive web design standards?

  • 1. Responsive web standards? Chris Mills Opera Software/W3C Friday, 7 December 12
  • 2. Who am I? * Works for Opera and W3C * Open standards evangelist * HTML5/CSS3 wrangler * Accessibility whinger * Education agitator * Heavy metal drummer Responsive web standards? Chris Mills Friday, 7 December 12
  • 3. Useful stuff @chrisdavidmills cmills@opera.com/cmills@w3.org slideshare.net/chrisdavidmills webplatform.org dev.opera.com Friday, 7 December 12
  • 4. A question Do web standards provide a good set of tools for responsive web design? Responsive web standards? Chris Mills Friday, 7 December 12
  • 5. The answer We’re getting there ;-) Responsive web standards? Chris Mills Friday, 7 December 12
  • 6. But the road has been hard Friday, 7 December 12
  • 7. CSS first existed circa 1996 Responsive web standards? Chris Mills Friday, 7 December 12
  • 8. But ... browser support? <table width="100%" style="height: 100%;" cellpadding="10" cellspacing="0" border="0"> <tr> <!-- ============ HEADER SECTION ============== --> <td colspan="2" style="height: 100px;" bgcolor="#777d6a"><h1>Website Logo</h1></td></tr> <tr> <!-- ============ LEFT COLUMN (MENU) ============== --> <td width="20%" valign="top" bgcolor="#999f8e"> <a href="#">Menu link</a><br> <a href="#">Menu link</a><br> <a href="#">Menu link</a><br> <a href="#">Menu link</a><br> <a href="#">Menu link</a> </td> Responsive web standards? Chris Mills Friday, 7 December 12
  • 9. CSS 1 and 2 had very few... ...RWD-friendly features Because RWD problems didn’t exist back then! Responsive web standards? Chris Mills Friday, 7 December 12
  • 10. Layout tools? Then again CSS2 has few layout tools ... Period. Responsive web standards? Chris Mills Friday, 7 December 12
  • 11. We still abuse floats and padding And positioning is good. But doesn’t solve everything. Responsive web standards? Chris Mills Friday, 7 December 12
  • 12. CSS2 has media types But they are largely flawed media=”screen”, media=”print” media=”handheld”, media=”tv” media=”wtf?” Responsive web standards? Chris Mills Friday, 7 December 12
  • 13. Surely they are all really “screen”? Friday, 7 December 12
  • 14. <img> was never responsive We had no need for responsive images when <img> was created Responsive web standards? Chris Mills Friday, 7 December 12
  • 15. And we’ve never had... * “Proper” layout modules * Feature detection * Access to hardware features * whinge whinge whinge... * ...I want it all yesterday... * ...etc. Responsive web standards? Chris Mills Friday, 7 December 12
  • 16. Whinge over Responsive web standards? Chris Mills Friday, 7 December 12
  • 17. The W3C process is long Responsive web standards? Chris Mills Friday, 7 December 12
  • 18. The W3C process is long * A problem first has to present itself * Someone has to propose a solution * Which has to be agreed by committee * After checking for the “P” word * And then implemented by browsers * And then adopted by developers Responsive web standards? Chris Mills Friday, 7 December 12
  • 19. Media queries succeed... ...where media types failed Responsive web standards? Chris Mills Friday, 7 December 12
  • 20. Media queries media="screen and (max-width: 481px)" @media screen and (max-width: 481px) { /* do amazing stuff for narrow screens */ } Responsive web standards? Chris Mills Friday, 7 December 12
  • 21. Media queries Responsive web standards? Chris Mills Friday, 7 December 12
  • 22. Viewport is also necessary For making mobile browsers behave! Responsive web standards? Chris Mills Friday, 7 December 12
  • 23. Viewport is also necessary Responsive web standards? Chris Mills Friday, 7 December 12
  • 24. Viewport is also necessary <meta name="viewport" content="width=device-width"> Responsive web standards? Chris Mills Friday, 7 December 12
  • 25. CSS device adaptation spec Does viewport stuff ... in CSS Responsive web standards? Chris Mills Friday, 7 December 12
  • 26. CSS device adaptation spec <meta name="viewport" content="width=550, maximum-scale=1.0, target-densitydpi=device-dpi"> @viewport { width: 550px; max-zoom: 1; resolution: device; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 27. CSS4 media queries * script * hover * pointer (none/coarse/fine) * luminosity (dim/normal/washed) Responsive web standards? Chris Mills Friday, 7 December 12
  • 28. Other media query ideas * paged * interactive * touch * keyboard * remote * network-speed Responsive web standards? Chris Mills Friday, 7 December 12
  • 29. CSS3 features “proper” layout * Flexbox * Multi-col layout * Grids * Regions * Exclusions and shapes * GCPM Responsive web standards? Chris Mills Friday, 7 December 12
  • 30. Example: Flexbox * Easier UI layout * Makes layout tasks much easier * Cross browser support getting there * Great for mobile UIs Responsive web standards? Chris Mills Friday, 7 December 12
  • 31. Example: Flexbox <section> <article id="first"></article> <article id="second"></article> <article id="third"></article> </section> Responsive web standards? Chris Mills Friday, 7 December 12
  • 32. Responsive web standards? Chris Mills Friday, 7 December 12
  • 33. Example: Flexbox section { display: flex; flex-flow: row; } section { display: flex; flex-flow: column; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 34. Responsive web standards? Chris Mills Friday, 7 December 12
  • 35. Example: Flexbox section { display: flex; flex-flow: row; align-items: center; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 36. Responsive web standards? Chris Mills Friday, 7 December 12
  • 37. Example: Flexbox #first, #third { order: 2; } #second { order: 1; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 38. Responsive web standards? Chris Mills Friday, 7 December 12
  • 39. Example: Flexbox #first { flex: 1; } #second { flex: 1; } #third { flex: 1; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 40. Responsive web standards? Chris Mills Friday, 7 December 12
  • 41. Example: Flexbox #first { flex: 1; } #second { flex: 1; } #third { flex: 2; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 42. Responsive web standards? Chris Mills Friday, 7 December 12
  • 43. Responsive replaced elements * max-width: 100% ... * HTML5 <video>: <source> media attributes * <picture> Responsive web standards? Chris Mills Friday, 7 December 12
  • 44. HTML5 <video> <source src="crystal320.webm" type="video/webm" media="all and (max- width: 480px)"> <source src="crystal720.webm" type="video/webm" media="all and (min- width: 481px)"> Responsive web standards? Chris Mills Friday, 7 December 12
  • 45. The <picture> element <picture alt="a picture of something"> <source src="mobile.jpg"> <source src="medium.jpg" media="min- width: 600px"> <source src="fullsize.jpg" media="min- width: 900px"> <img src="mobile.jpg"> <!-- fallback for non-supporting browsers --> </picture> Responsive web standards? Chris Mills Friday, 7 December 12
  • 46. Other useful image features * object-fit / object-position * background-image: image('image.png#xywh=150,250,100,100'); * background-image: image("wavy.svg", 'wavy.png' , "wavy.gif"); Responsive web standards? Chris Mills Friday, 7 December 12
  • 47. object-fit/object-position img { width: 300px; height: 300px; ... object-fit: contain; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 48. Image fragments background-image: image('image.png#xywh=15,30,150,120'); Responsive web standards? Chris Mills Friday, 7 December 12
  • 49. Misc responsive features * matchMedia * Native feature detection with @supports * CSS3 web fonts for icons * unicode-range Responsive web standards? Chris Mills Friday, 7 December 12
  • 50. matchMedia if (window.matchMedia("(min-width: 400px)").matches) { /* Do stuff for wider screens */ } else { /* Do stuff for narrow screens */ } Responsive web standards? Chris Mills Friday, 7 December 12
  • 51. @supports @supports (display:flex) { section { display: flex } ... } Responsive web standards? Chris Mills Friday, 7 December 12
  • 52. unicode-range @font-face { font-family: myFont; src: local(myFont), url(/fonts/myFont.otf); unicode-range: U+000-49F, U+2000-27FF; } Responsive web standards? Chris Mills Friday, 7 December 12
  • 53. Thanks! @chrisdavidmills cmills@opera.com/cmills@w3.org slideshare.net/chrisdavidmills webplatform.org dev.opera.com Friday, 7 December 12