SlideShare a Scribd company logo
Responsive design: techniques and
tricks to prepare your websites for
the multi-screen future                         Andreas Bovens - Opera Software
http://www.flickr.com/photos/redux/7145995789/
Responsive design: techniques and
tricks to prepare your websites for
the multi-screen future                         Andreas Bovens - Opera Software
http://www.flickr.com/photos/redux/7145995789/
@andreasbovens
“Patterns for
Multiscreen
Strategies”
                                  Coherence                      Syncronization                   Screen sharing


By Precious
http:/
     /slidesha.re/kiip5y

                                Device shifting                 Complementarity                     Simultaneity

                           These patterns should help understand and define strategies for the multiscreen world.
Coherence                      Syncronization                   Screen sharing




     Device shifting                 Complementarity                     Simultaneity

These patterns should help understand and define strategies for the multiscreen world.

                                                                                  http:/
                                                                                       /slidesha.re/kiip5y
“A digital product or
service looks and
works coherently
across devices.
Features are
optimized for
specific device
characteristics and
usage scenarios.”
                        Coherence
                                    http:/
                                         /slidesha.re/kiip5y
Coherence
        http://slidesha.re/kiip5y
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
?
small screen rendering
         aka single column view
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
zoom and pan
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
“Nice, but how can we control
this zooming behavior?”
Let’s talk about the
viewport mechanism
This is the viewport.
<meta ...>
             Using a "viewport"
             meta tag in the
             <head> of the page...
...we can control page
width & height, zoom
level, etc.
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
This works in:




with some exceptions ;-)
http:/
     /www.opera.com/developer/tools/mobile/
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait
HVGA portrait




                no viewport defined in <head>,
                so fallback to default of 980px,
                which is squeezed inside
                320px.
HVGA portrait




                <meta name="viewport"
                content="width=320">
HVGA portrait




                <meta name="viewport"
                content="width=320">
HVGA portrait   HVGA landscape




                <meta name="viewport"
                content="width=320">
HVGA portrait




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




                <meta name="viewport"
                content="width=device-width">
HVGA portrait   HVGA landscape




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




      480px
                       320px × 1.5 zoom
HVGA portrait




                <meta name="viewport"
                content="initial-scale=1">
HVGA portrait




                <meta name="viewport"
                content="initial-scale=1">
HVGA portrait   HVGA landscape




                <meta name="viewport"
                content="initial-scale=1">
HVGA portrait   HVGA landscape




                <meta name="viewport"
                content="initial-scale=1">
                     (same result as width=device-width)
HVGA portrait   HVGA landscape




                <meta name="viewport"
                content="initial-scale=0.5">
HVGA portrait   HVGA landscape




                <meta name="viewport"
                content="initial-scale=2">
<meta name="viewport"
content="width=device-width">

+
<div style="width: 600px">
HVGA portrait




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

                +
                <div style="width: 600px">
HVGA portrait




                <meta name="viewport"
                content="width=device-width,
                initial-scale=1">
                +
                <div style="width: 600px">
other settings
maximum-scale=... , minimum-scale=...
<meta name="viewport" content="initial-scale=1, maximum-scale=1.5">
user-scalable=yes|no
<meta name="viewport" content="width=320, user-scalable=no">
height=...
<meta name="viewport" content="height=device-height">
other settings
maximum-scale=... , minimum-scale=...
<meta name="viewport" content="initial-scale=1, maximum-scale=1.5">
user-scalable=yes|no
<meta name="viewport" content="width=320, user-scalable=no">
height=...
<meta name="viewport" content="height=device-height">
other settings
maximum-scale=... , minimum-scale=...
<meta name="viewport" content="initial-scale=1, maximum-scale=1.5">
user-scalable=yes|no
<meta name="viewport" content="width=320, user-scalable=no">
height=...
<meta name="viewport" content="height=device-height">
other settings
maximum-scale=... , minimum-scale=...
<meta name="viewport" content="initial-scale=1, maximum-scale=1.5">
user-scalable=yes|no
<meta name="viewport" content="width=320, user-scalable=no">
height=...
<meta name="viewport" content="height=device-height">
Important!
Make sure to use commas, not semi-colons
as delimiters between viewport values!
 <meta name="viewport" content="initial-scale=1; user-scalable=no">
 <meta name="viewport" content="initial-scale=1, user-scalable=no">
caveats
Android Browser doesn’t support user-scalable=no.
IE interprets width=device-width as 320px.
Safari on iPad always interprets width=device-width
as 768px, although it’s 1024px wide in landscape
mode. This can be overridden with initial-scale=1,
which... triggers a zooming bug* on orientation
change.
                * Patch: https:/
                               /github.com/scottjehl/iOS-Orientationchange-Fix
http://www.flickr.com/photos/33284937@N04/4771132618/
So, how to use this?
Sniff for mobile
browsers maybe?
So, how to use this?
Sniff for mobile
browsers maybe?
Better don’t sniff.
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Opera/9.80 (Macintosh; Intel Mac OS X 10.5.8; U; en) Presto/2.9.220 Version/12.00
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
So, avoid sniffing,
but if you really have to,
provide a way for users
to make corrections,
and remember their
preference.
So, avoid sniffing,
but if you really have to*,
provide a way for users
to make corrections,
and remember their
preference.
* always ask yourself why the mobile site should be
different from the desktop site
* always ask yourself why the mobile site should be
     different from the desktop site



customer requir
                  ements
                                         tim e restrictions

                  budget limitations

capabilities are different
                                 different layout needed
* always ask yourself why the mobile site should be
     different from the desktop site



customer requir
                  ements
                                         tim e restrictions

                  budget limitations

capabilities are different
                                 different layout needed
* always ask yourself why the mobile site should be
     different from the desktop site



customer requir
                   ements
                                         tim e restrictions

                   budget limitations

capabilities are different
                                 different layout needed
     capability detection
* always ask yourself why the mobile site should be
     different from the desktop site



customer requir
                   ements
                                         tim e restrictions

                   budget limitations

capabilities are different
                                 different layout needed
     capability detection
                                    viewport + media queries
Let’s talk about media queries
Media queries are conditional
hooks for applying different
CSS rules, depending on e.g.
browser width or height,
orientation, aspect ratio, etc.
Differently said, media queries
allow you to optimize your site
layout for all kinds of form factors.




                            Via http://mediaqueri.es/
@media screen
         and (min-width: 400px)
         and (max-width: 800px) {
   article {
      /* css for browsers with width ≥ 400px and
         ≤ 800px */
      }
 }
@media screen
         and (aspect-ratio: 16/9)
         and (orientation: landscape) {
   article {
      /* css for browsers with an aspect ratio of
         16/9 and orientation is landscape */
      }
 }
@media screen
         and (max-width: 800px) {
   article {
      /* css for browsers with width ≤ 800px */
      }
 }
@media screen and (max-width: 400px) {
   article {
      /* css for browsers with width ≤ 400px */
      }
 }
@media screen and (max-width: 400px) {
     article {
        /* css for browsers with width ≤ 400px */
        }
   }


Remember that mobile browsers have
a default viewport width (e.g. 980px).
For your mobile specific media queries
to work, you need to set the viewport!
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
default viewport.      width=device-width.
mobile specific media    mobile specific media
 queries not applied.      queries applied.
The viewport and media queries
combo allows you to create
just one responsive site
that works everywhere.
Q: What do I start with, desktop or mobile?

A: Do mobile first, and build up your desktop
styles from there.
Q: Which devices, screen sizes should I design for?

A: All of them! Use content breakpoints, instead of
device breakpoints and you’ll get a long way.
http:/
     /www.flickr.com/photos/33284937@N04/5445675024/
Dealing with
high-PPI “Retina” screens
A pixel is not what it seems.
Thus far, we’ve talked about
pixels in terms of “CSS pixels”.
One CSS pixel can be multiple
device pixels.
HVGA portrait




almost WVGA portrait
HVGA portrait




almost WVGA portrait
almost WVGA portrait
Browser pretends
that 480px is 320px.
In most scenarios, you won’t
have to worry about this.
It just works.
However, if you want to
control PPI related stuff,
these are the things you can do:
almost WVGA portrait
(1)
Set the meta
viewport’s
target-densitydpi
to device-dpi.
almost WVGA portrait
(1)
Everything is
shown at 100%.
One CSS pixel is
equal to one device
pixel.
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
almost WVGA portrait
(2)
Use special device-
pixel-ratio media
query to serve
PPI-specific CSS.
almost WVGA portrait
I’ve set the
1500×1500px
background-image
to repeat every
1000px, making it
crispy again. The
rest of the content
is still scaled 150%.
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
caveats

-o-max/min-device-pixel-ratio uses fractions
instead of numbers. So 3/2, not 1.5.

Watch out for max/min--moz-device-pixel-ratio.
max/min-device-pixel-ratio might be dropped,
and we get a resolution media query instead.

@media screen and (min-device-pixel-ratio: 3/2) {
  body {background-size: 250px;}
}
would become:

@media screen and (min-resolution: 1.5dppx) {
  body {background-size: 250px;}
}
almost WVGA portrait
(3)
Use high-res
images to preserve
crispiness.
Responsive design: techniques and tricks to prepare your websites for the multi-screen future
http:/
     /www.w3.org/community/respimg/
You will be able to specify multiple image sources:

  <picture>
  <source media="(orientation: landscape)"
  srcset="long.jpg 1x, long2.jpg 2x">
  <source media="(orientation: portrait)"
  srcset="tall.jpg 1x, tall2.jpg 2x">
  <img src="fallback.jpg" />
  </picture>
You already can specify multiple video sources:

  <video>
  <source type="video/webm" src="small.webm"
  media="all and (max-width: 480px)">
  <source type="video/webm" src="large.webm"
  media="all and (min-width: 481px)" >
  </video>
Sidenote about another responsive image technique:




object-fit and object-position allow you to crop images
simple resize
resize with
object-fit and
object-position
adjustments
http:/
     /dev.opera.com/articles/view/css3-object-fit-object-position/
http://www.flickr.com/photos/33284937@N04/5588693890/
Why do all this viewport
stuff with <meta> tags?
Isn’t this something for CSS?
http:/
     /dev.w3.org/csswg/css-device-adapt/
<meta name="viewport" content="width=device-
width, initial-scale=1, user-scalable=no">

becomes

@viewport {
  width: device-width;
  zoom: 1;
  user-zoom: fixed;
}
<meta name="viewport" content="width=device-
width, initial-scale=1, user-scalable=no">

becomes

@-o-/-ms-viewport {
  width: device-width;
  zoom: 1;
  user-zoom: fixed;
}
http:/
     /dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/
Responsive design: techniques and
tricks to prepare your websites for
the multi-screen future                         Andreas Bovens - Opera Software
http://www.flickr.com/photos/redux/7145995789/
Responsive design: techniques and
tricks to prepare your websites for
the multi-screen future nt
                   prese                        Andreas Bovens - Opera Software
http://www.flickr.com/photos/redux/7145995789/
Thank you!
                                              @andreasbovens


Dosis font: http:/
                 /www.impallari.com/dosis
Glyphicons: http:/
                 /glyphicons.com/glyphicons-licenses/
Corkboard background: http:/
                           /psd.tutsplus.com/freebies/texture/corkboard-texture-pack/

More Related Content

PPTX
Bresenham-Circle-drawing-algorithm, Midpoint Circle Drawing Algorithm
PPT
Uml class-diagram
PPTX
Window to viewport transformation&amp;matrix representation of homogeneous co...
PPTX
Introduction to Image Processing:Image Modalities
PPTX
Halftoning in Computer Graphics
DOCX
Bezier Curve in Computer Graphics.docx
PPTX
3D Transformation in Computer Graphics
PDF
Computer graphics curves and surfaces (1)
Bresenham-Circle-drawing-algorithm, Midpoint Circle Drawing Algorithm
Uml class-diagram
Window to viewport transformation&amp;matrix representation of homogeneous co...
Introduction to Image Processing:Image Modalities
Halftoning in Computer Graphics
Bezier Curve in Computer Graphics.docx
3D Transformation in Computer Graphics
Computer graphics curves and surfaces (1)

What's hot (20)

PPTX
Image Sensing and Acquisition.pptx
PPTX
Distributed Database Management System
PDF
Design principle of pattern recognition system and STATISTICAL PATTERN RECOGN...
PPTX
Hidden surface removal algorithm
PPTX
Object Detection & Tracking
PPTX
data base management system (DBMS)
PPTX
Software Architecture Styles
PPTX
Planning in AI(Partial order planning)
PPTX
Forests in data structures and algorithms .pptx
PPTX
Fuzzy rule based expert system for diagnosis of lung cancer
PPS
Architecture of-dbms-and-data-independence
PPTX
Bezeir curve na B spline Curve
PPT
Pressman ch-11-component-level-design
PPTX
Distributed Databases
PPTX
Graphics_3D viewing
PPTX
Hidden surface removal
PPTX
Direct linking loaders
PPTX
OLAP operations
PPT
Quadric surfaces
PPTX
Topological sort
Image Sensing and Acquisition.pptx
Distributed Database Management System
Design principle of pattern recognition system and STATISTICAL PATTERN RECOGN...
Hidden surface removal algorithm
Object Detection & Tracking
data base management system (DBMS)
Software Architecture Styles
Planning in AI(Partial order planning)
Forests in data structures and algorithms .pptx
Fuzzy rule based expert system for diagnosis of lung cancer
Architecture of-dbms-and-data-independence
Bezeir curve na B spline Curve
Pressman ch-11-component-level-design
Distributed Databases
Graphics_3D viewing
Hidden surface removal
Direct linking loaders
OLAP operations
Quadric surfaces
Topological sort
Ad

Viewers also liked (20)

PPT
Road Safety Project PowerPoint Presentation, Road safety ppt pps pdf photos i...
PDF
SEISMIC_DESIGN
PDF
Deep Learning - Convolutional Neural Networks
ODP
Mathematics high school level quiz - Part I
PDF
Farming Unicorns: Building Startup & Investor Ecosystems
PPTX
70+ Inspirational Quotes from Cannes Lions 2012
PPT
Pharmaceuticals Solutions dosage form
PDF
Prepared Speech Presentation
PPTX
DepEd Order No. 47 s. 2014: CONSTITUTION AND BY - LAWS OF THE SUPREME PUPIL G...
PPTX
Education at a Glance 2015 - Global Launch
PPT
Stanford E245 Lean LaunchPad winter 10 session 01 course overview rev 4
PDF
What Do Real Women Look Like? 100 Stock Photos of Real Women
PDF
The Science of Website Redesign
PDF
5000 Sat Words With Definitions
PPTX
Mac OS(Operating System)
PPTX
4. heredity and evolution
PDF
Engaging Learners with Technology
PDF
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
PPT
Basics of c++ Programming Language
PPTX
Fintech and Transformation of the Financial Services Industry
Road Safety Project PowerPoint Presentation, Road safety ppt pps pdf photos i...
SEISMIC_DESIGN
Deep Learning - Convolutional Neural Networks
Mathematics high school level quiz - Part I
Farming Unicorns: Building Startup & Investor Ecosystems
70+ Inspirational Quotes from Cannes Lions 2012
Pharmaceuticals Solutions dosage form
Prepared Speech Presentation
DepEd Order No. 47 s. 2014: CONSTITUTION AND BY - LAWS OF THE SUPREME PUPIL G...
Education at a Glance 2015 - Global Launch
Stanford E245 Lean LaunchPad winter 10 session 01 course overview rev 4
What Do Real Women Look Like? 100 Stock Photos of Real Women
The Science of Website Redesign
5000 Sat Words With Definitions
Mac OS(Operating System)
4. heredity and evolution
Engaging Learners with Technology
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
Basics of c++ Programming Language
Fintech and Transformation of the Financial Services Industry
Ad

Similar to Responsive design: techniques and tricks to prepare your websites for the multi-screen future (20)

PDF
Responsive Websites
PDF
Great Responsive-ability Web Design
PDF
The specs behind the sex, mobile-friendly layout beyond the desktop
PDF
Html 5 mobile - nitty gritty
PDF
Mobile web development techniques (and Opera's developer tools)
PDF
Intro to @viewport & other new Responsive Web Design CSS features
KEY
Responsive UX - One size fits all @BigDesign conference #BigD12
PDF
Responsive Web Designed for your communication and marketing needs
PDF
Adaptive layouts - standards>next Manchester 23.03.2011
PDF
Pinkoi Mobile Web
PDF
Responsive Web in Brief
PDF
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
PDF
Multi screen HTML5
PDF
Web Development for UX Designers
PPTX
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
PDF
Responsive design
PPSX
Responsive Web Design: Tips and Tricks
PPTX
Lab#13 responsive web
PDF
Responsive websites. Toolbox
PDF
Creating a Responsive Drupal Theme: Presentation from DrupalCamp Montreal 2012
Responsive Websites
Great Responsive-ability Web Design
The specs behind the sex, mobile-friendly layout beyond the desktop
Html 5 mobile - nitty gritty
Mobile web development techniques (and Opera's developer tools)
Intro to @viewport & other new Responsive Web Design CSS features
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive Web Designed for your communication and marketing needs
Adaptive layouts - standards>next Manchester 23.03.2011
Pinkoi Mobile Web
Responsive Web in Brief
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
Multi screen HTML5
Web Development for UX Designers
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive design
Responsive Web Design: Tips and Tricks
Lab#13 responsive web
Responsive websites. Toolbox
Creating a Responsive Drupal Theme: Presentation from DrupalCamp Montreal 2012

More from Andreas Bovens (7)

PPTX
Progressive Web Apps: Opera's perspective
PDF
Fast & Furious: Speed in the Opera browser
PDF
SVG in Opera’s desktop, mobile & TV browsers — edition 2011
PDF
Building rich apps with HTML5 and friends
KEY
SVG in the Opera browser
PDF
Opera and the Open Web platform
PDF
Opera Widgets for Desktop and Opera Dragonfly
Progressive Web Apps: Opera's perspective
Fast & Furious: Speed in the Opera browser
SVG in Opera’s desktop, mobile & TV browsers — edition 2011
Building rich apps with HTML5 and friends
SVG in the Opera browser
Opera and the Open Web platform
Opera Widgets for Desktop and Opera Dragonfly

Recently uploaded (20)

PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
PDF
Why Endpoint Security Is Critical in a Remote Work Era?
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
Google’s NotebookLM Unveils Video Overviews
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
PDF
Dell Pro 14 Plus: Be better prepared for what’s coming
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
A Day in the Life of Location Data - Turning Where into How.pdf
Chapter 2 Digital Image Fundamentals.pdf
NewMind AI Weekly Chronicles - July'25 - Week IV
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
Why Endpoint Security Is Critical in a Remote Work Era?
creating-agentic-ai-solutions-leveraging-aws.pdf
Transforming Manufacturing operations through Intelligent Integrations
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Smarter Business Operations Powered by IoT Remote Monitoring
Google’s NotebookLM Unveils Video Overviews
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Dell Pro 14 Plus: Be better prepared for what’s coming
Revolutionize Operations with Intelligent IoT Monitoring and Control
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
agentic-ai-and-the-future-of-autonomous-systems.pdf

Responsive design: techniques and tricks to prepare your websites for the multi-screen future

  • 1. Responsive design: techniques and tricks to prepare your websites for the multi-screen future Andreas Bovens - Opera Software http://www.flickr.com/photos/redux/7145995789/
  • 2. Responsive design: techniques and tricks to prepare your websites for the multi-screen future Andreas Bovens - Opera Software http://www.flickr.com/photos/redux/7145995789/
  • 4. “Patterns for Multiscreen Strategies” Coherence Syncronization Screen sharing By Precious http:/ /slidesha.re/kiip5y Device shifting Complementarity Simultaneity These patterns should help understand and define strategies for the multiscreen world.
  • 5. Coherence Syncronization Screen sharing Device shifting Complementarity Simultaneity These patterns should help understand and define strategies for the multiscreen world. http:/ /slidesha.re/kiip5y
  • 6. “A digital product or service looks and works coherently across devices. Features are optimized for specific device characteristics and usage scenarios.” Coherence http:/ /slidesha.re/kiip5y
  • 7. Coherence http://slidesha.re/kiip5y
  • 9. ?
  • 10. small screen rendering aka single column view
  • 22. “Nice, but how can we control this zooming behavior?”
  • 23. Let’s talk about the viewport mechanism
  • 24. This is the viewport.
  • 25. <meta ...> Using a "viewport" meta tag in the <head> of the page...
  • 26. ...we can control page width & height, zoom level, etc.
  • 29. This works in: with some exceptions ;-)
  • 30. http:/ /www.opera.com/developer/tools/mobile/
  • 41. HVGA portrait no viewport defined in <head>, so fallback to default of 980px, which is squeezed inside 320px.
  • 42. HVGA portrait <meta name="viewport" content="width=320">
  • 43. HVGA portrait <meta name="viewport" content="width=320">
  • 44. HVGA portrait HVGA landscape <meta name="viewport" content="width=320">
  • 45. HVGA portrait <meta name="viewport" content="width=device-width">
  • 46. HVGA portrait <meta name="viewport" content="width=device-width">
  • 47. HVGA portrait HVGA landscape <meta name="viewport" content="width=device-width">
  • 48. HVGA landscape HVGA landscape 480px 320px × 1.5 zoom
  • 49. HVGA portrait <meta name="viewport" content="initial-scale=1">
  • 50. HVGA portrait <meta name="viewport" content="initial-scale=1">
  • 51. HVGA portrait HVGA landscape <meta name="viewport" content="initial-scale=1">
  • 52. HVGA portrait HVGA landscape <meta name="viewport" content="initial-scale=1"> (same result as width=device-width)
  • 53. HVGA portrait HVGA landscape <meta name="viewport" content="initial-scale=0.5">
  • 54. HVGA portrait HVGA landscape <meta name="viewport" content="initial-scale=2">
  • 56. HVGA portrait <meta name="viewport" content="width=device-width"> + <div style="width: 600px">
  • 57. HVGA portrait <meta name="viewport" content="width=device-width, initial-scale=1"> + <div style="width: 600px">
  • 58. other settings maximum-scale=... , minimum-scale=... <meta name="viewport" content="initial-scale=1, maximum-scale=1.5"> user-scalable=yes|no <meta name="viewport" content="width=320, user-scalable=no"> height=... <meta name="viewport" content="height=device-height">
  • 59. other settings maximum-scale=... , minimum-scale=... <meta name="viewport" content="initial-scale=1, maximum-scale=1.5"> user-scalable=yes|no <meta name="viewport" content="width=320, user-scalable=no"> height=... <meta name="viewport" content="height=device-height">
  • 60. other settings maximum-scale=... , minimum-scale=... <meta name="viewport" content="initial-scale=1, maximum-scale=1.5"> user-scalable=yes|no <meta name="viewport" content="width=320, user-scalable=no"> height=... <meta name="viewport" content="height=device-height">
  • 61. other settings maximum-scale=... , minimum-scale=... <meta name="viewport" content="initial-scale=1, maximum-scale=1.5"> user-scalable=yes|no <meta name="viewport" content="width=320, user-scalable=no"> height=... <meta name="viewport" content="height=device-height">
  • 62. Important! Make sure to use commas, not semi-colons as delimiters between viewport values! <meta name="viewport" content="initial-scale=1; user-scalable=no"> <meta name="viewport" content="initial-scale=1, user-scalable=no">
  • 63. caveats Android Browser doesn’t support user-scalable=no. IE interprets width=device-width as 320px. Safari on iPad always interprets width=device-width as 768px, although it’s 1024px wide in landscape mode. This can be overridden with initial-scale=1, which... triggers a zooming bug* on orientation change. * Patch: https:/ /github.com/scottjehl/iOS-Orientationchange-Fix
  • 65. So, how to use this? Sniff for mobile browsers maybe?
  • 66. So, how to use this? Sniff for mobile browsers maybe? Better don’t sniff.
  • 74. Opera/9.80 (Macintosh; Intel Mac OS X 10.5.8; U; en) Presto/2.9.220 Version/12.00
  • 80. So, avoid sniffing, but if you really have to, provide a way for users to make corrections, and remember their preference.
  • 81. So, avoid sniffing, but if you really have to*, provide a way for users to make corrections, and remember their preference. * always ask yourself why the mobile site should be different from the desktop site
  • 82. * always ask yourself why the mobile site should be different from the desktop site customer requir ements tim e restrictions budget limitations capabilities are different different layout needed
  • 83. * always ask yourself why the mobile site should be different from the desktop site customer requir ements tim e restrictions budget limitations capabilities are different different layout needed
  • 84. * always ask yourself why the mobile site should be different from the desktop site customer requir ements tim e restrictions budget limitations capabilities are different different layout needed capability detection
  • 85. * always ask yourself why the mobile site should be different from the desktop site customer requir ements tim e restrictions budget limitations capabilities are different different layout needed capability detection viewport + media queries
  • 86. Let’s talk about media queries
  • 87. Media queries are conditional hooks for applying different CSS rules, depending on e.g. browser width or height, orientation, aspect ratio, etc.
  • 88. Differently said, media queries allow you to optimize your site layout for all kinds of form factors. Via http://mediaqueri.es/
  • 89. @media screen and (min-width: 400px) and (max-width: 800px) { article { /* css for browsers with width ≥ 400px and ≤ 800px */ } }
  • 90. @media screen and (aspect-ratio: 16/9) and (orientation: landscape) { article { /* css for browsers with an aspect ratio of 16/9 and orientation is landscape */ } }
  • 91. @media screen and (max-width: 800px) { article { /* css for browsers with width ≤ 800px */ } } @media screen and (max-width: 400px) { article { /* css for browsers with width ≤ 400px */ } }
  • 92. @media screen and (max-width: 400px) { article { /* css for browsers with width ≤ 400px */ } } Remember that mobile browsers have a default viewport width (e.g. 980px). For your mobile specific media queries to work, you need to set the viewport!
  • 94. default viewport. width=device-width. mobile specific media mobile specific media queries not applied. queries applied.
  • 95. The viewport and media queries combo allows you to create just one responsive site that works everywhere.
  • 96. Q: What do I start with, desktop or mobile? A: Do mobile first, and build up your desktop styles from there.
  • 97. Q: Which devices, screen sizes should I design for? A: All of them! Use content breakpoints, instead of device breakpoints and you’ll get a long way.
  • 98. http:/ /www.flickr.com/photos/33284937@N04/5445675024/
  • 100. A pixel is not what it seems. Thus far, we’ve talked about pixels in terms of “CSS pixels”. One CSS pixel can be multiple device pixels.
  • 103. almost WVGA portrait Browser pretends that 480px is 320px.
  • 104. In most scenarios, you won’t have to worry about this. It just works.
  • 105. However, if you want to control PPI related stuff, these are the things you can do:
  • 106. almost WVGA portrait (1) Set the meta viewport’s target-densitydpi to device-dpi.
  • 107. almost WVGA portrait (1) Everything is shown at 100%. One CSS pixel is equal to one device pixel.
  • 109. almost WVGA portrait (2) Use special device- pixel-ratio media query to serve PPI-specific CSS.
  • 110. almost WVGA portrait I’ve set the 1500×1500px background-image to repeat every 1000px, making it crispy again. The rest of the content is still scaled 150%.
  • 112. caveats -o-max/min-device-pixel-ratio uses fractions instead of numbers. So 3/2, not 1.5. Watch out for max/min--moz-device-pixel-ratio.
  • 113. max/min-device-pixel-ratio might be dropped, and we get a resolution media query instead. @media screen and (min-device-pixel-ratio: 3/2) { body {background-size: 250px;} } would become: @media screen and (min-resolution: 1.5dppx) { body {background-size: 250px;} }
  • 114. almost WVGA portrait (3) Use high-res images to preserve crispiness.
  • 116. http:/ /www.w3.org/community/respimg/
  • 117. You will be able to specify multiple image sources: <picture> <source media="(orientation: landscape)" srcset="long.jpg 1x, long2.jpg 2x"> <source media="(orientation: portrait)" srcset="tall.jpg 1x, tall2.jpg 2x"> <img src="fallback.jpg" /> </picture>
  • 118. You already can specify multiple video sources: <video> <source type="video/webm" src="small.webm" media="all and (max-width: 480px)"> <source type="video/webm" src="large.webm" media="all and (min-width: 481px)" > </video>
  • 119. Sidenote about another responsive image technique: object-fit and object-position allow you to crop images
  • 122. http:/ /dev.opera.com/articles/view/css3-object-fit-object-position/
  • 124. Why do all this viewport stuff with <meta> tags? Isn’t this something for CSS?
  • 125. http:/ /dev.w3.org/csswg/css-device-adapt/
  • 126. <meta name="viewport" content="width=device- width, initial-scale=1, user-scalable=no"> becomes @viewport { width: device-width; zoom: 1; user-zoom: fixed; }
  • 127. <meta name="viewport" content="width=device- width, initial-scale=1, user-scalable=no"> becomes @-o-/-ms-viewport { width: device-width; zoom: 1; user-zoom: fixed; }
  • 128. http:/ /dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/
  • 129. Responsive design: techniques and tricks to prepare your websites for the multi-screen future Andreas Bovens - Opera Software http://www.flickr.com/photos/redux/7145995789/
  • 130. Responsive design: techniques and tricks to prepare your websites for the multi-screen future nt prese Andreas Bovens - Opera Software http://www.flickr.com/photos/redux/7145995789/
  • 131. Thank you! @andreasbovens Dosis font: http:/ /www.impallari.com/dosis Glyphicons: http:/ /glyphicons.com/glyphicons-licenses/ Corkboard background: http:/ /psd.tutsplus.com/freebies/texture/corkboard-texture-pack/

Editor's Notes