Adapt and respond: keeping responsive into the future
-
Upload
chris-mills -
Category
Technology
-
view
105 -
download
3
description
Transcript of Adapt and respond: keeping responsive into the future
![Page 1: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/1.jpg)
Monday, 5 November 12
![Page 2: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/2.jpg)
Hi.I am chris mills.
‣Open standards advocate and Education agitator
‣dev.opera.com editor‣W3C fellow, workingon webplatform.org
‣Accessibility whiner‣HTML5/CSS3 wrangler‣Heavy metal drummerand proud dad
Monday, 5 November 12
![Page 3: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/3.jpg)
Monday, 5 November 12
![Page 4: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/4.jpg)
useful stuff
‣dev.opera.com‣webplatform.org‣slideshare.net/chrisdavidmills
‣[email protected]‣@chrisdavidmills
Monday, 5 November 12
![Page 5: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/5.jpg)
in this talk... ‣MQ: Beyond width and height‣Other “responsive modules”‣Legacy support‣RWD for the future
Monday, 5 November 12
![Page 6: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/6.jpg)
Monday, 5 November 12
![Page 7: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/7.jpg)
A quick flashback
Monday, 5 November 12
![Page 8: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/8.jpg)
In the beginning...
‣There wasn’t much RWD‣We only really looked at the Web on desktops/laptops
Monday, 5 November 12
![Page 9: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/9.jpg)
Ok. We had wap
Monday, 5 November 12
![Page 10: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/10.jpg)
Monday, 5 November 12
![Page 11: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/11.jpg)
Monday, 5 November 12
![Page 12: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/12.jpg)
Then the mobile web arrived
Monday, 5 November 12
![Page 13: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/13.jpg)
Then the mobile web arrived
Monday, 5 November 12
![Page 14: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/14.jpg)
Then the mobile web arrived
Monday, 5 November 12
![Page 15: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/15.jpg)
Then the mobile web arrived
Monday, 5 November 12
![Page 16: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/16.jpg)
media typesmedia="screen"
media="print"
Monday, 5 November 12
![Page 17: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/17.jpg)
media typesmedia="handheld"
media="tv"
Monday, 5 November 12
![Page 18: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/18.jpg)
small tv rant“Searching, browsing, updating and buffering are not TV-like. In fact an enormous number of people found that the technology they had purchased wasn't what they expected at all, that they were bringing the worst parts of using a computer into the television environment.”
-- www.insideci.co.uk/news/rovi-research-reveals-changing-consumer-habits.aspx
Monday, 5 November 12
![Page 19: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/19.jpg)
small tv rant“Searching, browsing, updating and buffering are not TV-like. In fact an enormous number of people found that the technology they had purchased wasn't what they expected at all, that they were bringing the worst parts of using a computer into the television environment.”
-- www.insideci.co.uk/news/rovi-research-reveals-changing-consumer-habits.aspx
Monday, 5 November 12
![Page 20: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/20.jpg)
Monday, 5 November 12
![Page 21: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/21.jpg)
Back to the modern world
Monday, 5 November 12
![Page 22: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/22.jpg)
media="screen and (max-width: 481px)"
@media screen and (max-width: 481px) { /* do amazing stuff for narrow screens */}
media queries
Monday, 5 November 12
![Page 23: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/23.jpg)
media queries
Monday, 5 November 12
![Page 24: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/24.jpg)
the mobile problem
Monday, 5 November 12
![Page 25: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/25.jpg)
<meta name="viewport" content="width=device-width">
viewport
Monday, 5 November 12
![Page 26: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/26.jpg)
other rwd issues
Monday, 5 November 12
![Page 27: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/27.jpg)
other rwd issues
Monday, 5 November 12
![Page 28: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/28.jpg)
Other considerations
‣Making replaced elements responsive
‣Bandwidth/loading of resources
‣Resolution‣Processing power‣Control mechanisms
Monday, 5 November 12
![Page 29: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/29.jpg)
replaced elements
Monday, 5 November 12
![Page 30: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/30.jpg)
replaced elements#related img {
display: block;
margin: 0 auto;
max-width: 100%;
}
Monday, 5 November 12
![Page 31: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/31.jpg)
be warned‣Old IE versions don’t support max-width, so you’ll have to fallback to width: 100% instead.
Monday, 5 November 12
![Page 32: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/32.jpg)
file size also important
‣Users on slow connections won’t want to download huge media files.
‣We need to try to serve them smaller files/alternatives.
‣Assumptions: e.g. narrow equals mobile equals slow connection
Monday, 5 November 12
![Page 33: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/33.jpg)
css resources easy to deal with
‣Use “mobile first” ‣Load smaller resources by default, and larger ones inside MQs
‣And in the future we’ve got things like image-set coming up (possibly...)
Monday, 5 November 12
![Page 34: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/34.jpg)
Mobile first example
header { background: url(small-image.png); }
@media screen and (min-width: 480px) { header { background: url(large-image.png); }}
Monday, 5 November 12
![Page 35: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/35.jpg)
html5 video also well served
<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)">
Monday, 5 November 12
![Page 36: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/36.jpg)
But html images are not so lucky
<img src="thats-all-folks.png"> ?
Monday, 5 November 12
![Page 37: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/37.jpg)
Various solutions
‣http://dev.opera.com/articles/view/responsive-images-problem/
‣None work perfectly‣Pre-fetch is a bitch
Monday, 5 November 12
![Page 38: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/38.jpg)
adaptive-images
‣adaptive-images.com‣Add .htaccess and adaptive-images.php to your document root folder.
‣Add one line of JavaScript into the <head> of your site.
‣Add your CSS Media Query values into $resolutions in the PHP file.
Monday, 5 November 12
![Page 39: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/39.jpg)
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>Monday, 5 November 12
![Page 40: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/40.jpg)
suggested solutions
‣Srcset‣New image formats?‣Defined the media tests in meta tags?
‣New headers and protocols?
Monday, 5 November 12
![Page 41: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/41.jpg)
processing power‣You might want to turn off effects like shadows, gradients and animations for small screen devices.
‣CSS effects are arguably less power draining than JS or Flash, but even so.
‣They can cause the display to look cluttered too.
Monday, 5 November 12
![Page 42: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/42.jpg)
resolution
Monday, 5 November 12
![Page 43: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/43.jpg)
resolution
Monday, 5 November 12
![Page 44: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/44.jpg)
resolution
Monday, 5 November 12
![Page 45: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/45.jpg)
resolution
64px
Monday, 5 November 12
![Page 46: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/46.jpg)
resolution
64px
48px
Monday, 5 November 12
![Page 47: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/47.jpg)
now we have hi fidelity devices
‣e.g. iPhone 4s is 960 x 640 pixels at 326ppi
‣These devices lie twice‣One CSS pixel = multiple device pixels
‣Images can start to look pixellated
Monday, 5 November 12
![Page 48: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/48.jpg)
SOLUTIONS
<img src="500px_image.jpg" width="250">
Monday, 5 November 12
![Page 49: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/49.jpg)
SOLUTIONS
@media screen and (-o-min-device-pixel-ratio: 3/2) {
body { background-size: 250px; }
}
@media screen and (-webkit-min-device-pixel-ratio: 1.5) {
body { background-size: 250px; }
}
Monday, 5 November 12
![Page 50: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/50.jpg)
Monday, 5 November 12
![Page 51: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/51.jpg)
soon to bereplaced by
@media screen and (resolution: 1.5dppx) {
body { background-size: 250px; }
}
Monday, 5 November 12
![Page 52: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/52.jpg)
tell the truth with viewport
<meta name="viewport"
content="width=device-width,
target-densitydpi=device-dpi">
Monday, 5 November 12
![Page 53: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/53.jpg)
All good but...
‣Images may now start to look a little small
‣You could serve larger images for devices with higher resolutions
Monday, 5 November 12
![Page 54: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/54.jpg)
control mechanisms‣Currently tricky‣Usual wisdom about web sites applies — make pages keyboard accessible, etc.
‣Can’t be detected in CSS(yet)
‣JavaScript touch detection is an option — Modernizr, jQuery
Monday, 5 November 12
![Page 55: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/55.jpg)
supporting older browsers
Monday, 5 November 12
![Page 56: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/56.jpg)
old ie versions
‣Lack support for media queries
‣Although we don’t get old IE on small screen devices
‣But mobile first is a problem
Monday, 5 November 12
![Page 57: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/57.jpg)
solutions
‣Provide fallbacks such as simpler layouts or pixels instead of % or rems
‣Use a media query polyfill such as respond.js
Monday, 5 November 12
![Page 58: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/58.jpg)
modernizr
<html lang="en-US" class="no-js">
<head>
<script src="modernizr.js"></script>
</head>
Monday, 5 November 12
![Page 59: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/59.jpg)
modernizr
<html class=" js flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms no-csstransforms3d csstransitions fontface generatedcontent video audio ... ">
Monday, 5 November 12
![Page 60: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/60.jpg)
modernizr css
#wrapper:hover, #wrapper:focus { transform: rotateX(180deg);}
Monday, 5 November 12
![Page 61: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/61.jpg)
modernizr css
.no-csstransforms3d #wrapper #front { transition: 0.8s all ease-in;}
.no-csstransforms3d #wrapper:hover #front,
.no-csstransforms3d #wrapper:focus #front { transform: rotate(-30deg) translate(-50%,-100%);}
Monday, 5 November 12
![Page 62: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/62.jpg)
modernizr JS
function rotateForm() { if(Modernizr.cssanimations && Modernizr.csstransforms3d) { form.setAttribute("class","form-rotate"); form.style.left = "0rem"; } else { back.style.zIndex = "5"; } }
Monday, 5 November 12
![Page 63: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/63.jpg)
@supports
@supports (display:flex) { section { display: flex } ...}
Monday, 5 November 12
![Page 64: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/64.jpg)
other responsive css3 modules
Monday, 5 November 12
![Page 65: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/65.jpg)
other responsive css3 modules
Monday, 5 November 12
![Page 66: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/66.jpg)
worthy of note
‣CSS device adaptation‣Flexbox‣Multi-col‣(Regions, Grids, etc.)
Monday, 5 November 12
![Page 67: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/67.jpg)
CSS device adaptation
‣Because viewport is really more of a CSS type thing than an HTML type thing
‣This spec provides a @viewport at-rule to contain viewport equivalents
‣Currently supported in Opera and IE10, with prefixes
‣dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport
Monday, 5 November 12
![Page 68: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/68.jpg)
CSS device adaptation
<meta name="viewport" content="width=550, maximum-scale=1.0, target-densitydpi=device-dpi">
@viewport { width: 550px; max-zoom: 1; resolution: device;}
Monday, 5 November 12
![Page 69: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/69.jpg)
Flex box
‣A spec for easier UIlayout
‣Makes certain layout tasks much easier
‣New syntax supportcurrently very limited
‣Old syntax supportedin most modernbrowsers
Monday, 5 November 12
![Page 70: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/70.jpg)
Flex box
<section> <article id="first"></article> <article id="second"></article> <article id="third"></article></section>
Monday, 5 November 12
![Page 71: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/71.jpg)
Monday, 5 November 12
![Page 72: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/72.jpg)
Flex box
section { display: flex; flex-flow: row;}
section { display: flex; flex-flow: column;}
Monday, 5 November 12
![Page 73: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/73.jpg)
Monday, 5 November 12
![Page 74: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/74.jpg)
Flex box
section { display: flex; flex-flow: row; align-items: center;}
Monday, 5 November 12
![Page 75: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/75.jpg)
Monday, 5 November 12
![Page 76: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/76.jpg)
Flex box
#first, #third { order: 2;}
#second { order: 1;}
Monday, 5 November 12
![Page 77: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/77.jpg)
Monday, 5 November 12
![Page 78: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/78.jpg)
Flex box
#first { flex: 1;}
#second { flex: 1;}
#third { flex: 1;}
Monday, 5 November 12
![Page 79: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/79.jpg)
Monday, 5 November 12
![Page 80: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/80.jpg)
Flex box
#first { flex: 1;}
#second { flex: 1;}
#third { flex: 2;}
Monday, 5 November 12
![Page 81: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/81.jpg)
Monday, 5 November 12
![Page 82: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/82.jpg)
multi col
‣A spec for breaking content into multiple columns.
‣Column widths/numbers, column rules, column spacing, column gaps, column breaks.
‣Supported across all major browsers, mostly.
Monday, 5 November 12
![Page 83: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/83.jpg)
Multi col
article { column-width: 20em; column-gap: 2em;}
Monday, 5 November 12
![Page 84: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/84.jpg)
Monday, 5 November 12
![Page 85: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/85.jpg)
other future developments
Monday, 5 November 12
![Page 86: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/86.jpg)
matchmedia
if (window.matchMedia("(min-width: 400px)").matches) { /* Do stuff for wider screens */} else { /* Do stuff for narrow screens */}
For IE9 and Opera, polyfill
github.com/paulirish/matchMedia.js/
Monday, 5 November 12
![Page 87: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/87.jpg)
script MQ
@media screen and (script) {...}@media screen and not (script) {...}
Monday, 5 November 12
![Page 88: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/88.jpg)
hover MQ
The ‘hover’ media feature is used to query whether the primary pointing system used on the output device can hover or not.
@media screen and (hover) {...}
Monday, 5 November 12
![Page 89: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/89.jpg)
pointer MQ
@media screen and (pointer: coarse) {...}
‣none: The input mechanism of the device does not include a pointing device.
‣coarse: The input mechanism of the device includes a pointing device of limited accuracy.
‣fine: The input mechanism of the device includes an accurate pointing device.
Monday, 5 November 12
![Page 90: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/90.jpg)
luminosity MQ
@media screen and (luminosity: dim) {...}
‣dim: The device is being used in a dim environment, such as nighttime.
‣normal: The device is being used in average lighting conditions, which don’t require significant adjustment.
‣washed: The device is being used in washed out conditions, e.g. in bright sunlight.
Monday, 5 November 12
![Page 91: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/91.jpg)
other future MQs
@media (paged) and (interactive:0) { // I am like a printer}@media (paged) and (interactive) { // I'm a projector, or like a Kindle}@media (paged) and (interactive) and (touch){ // I'm like a touch-screen Kindle}
Monday, 5 November 12
![Page 92: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/92.jpg)
other future MQs
@media (touch) and (max-width: 480) { // looks like an smart phone}@media (touch) and (keyboard) and(min-width:600) { // looks like a touch-screen laptop}
Monday, 5 November 12
![Page 93: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/93.jpg)
other future MQs
@media (remote) { // TV or set-top box?}@media (remote) and (hover) { // Wii?}
Monday, 5 November 12
![Page 94: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/94.jpg)
other future MQs
@media (network: v-slow) {...}
“It has been proposed. Most people agree that it would be cool, nobody has a clue about how to spec it ... submit proposals to me or to [email protected]. Use [css4-mediaqueries] in the subject line, and read lists.w3.org/Archives/Public/wwwstyle/2012Mar/0691.html first.”
-- Florian Rivoal
Monday, 5 November 12
![Page 95: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/95.jpg)
Buy my book
“Subtle” advertisement
Monday, 5 November 12
![Page 96: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/96.jpg)
game over
1up 0000000Monday, 5 November 12
![Page 97: Adapt and respond: keeping responsive into the future](https://reader034.fdocuments.us/reader034/viewer/2022051819/54c77dab4a79590c788b4627/html5/thumbnails/97.jpg)
01. dev.opera.com
02. slideshare.net/chrisdavidmills
04. @chrisdavidmills
05. Practical CSS3: Develop & Design
06. www.w3.org/Style/CSS/current-work.en.html
07. http://dev.w3.org/csswg/mediaqueries4/
08. CDM
09. WOW
game over
1up 0000000Monday, 5 November 12