SlideShare a Scribd company logo
1 of 58
Download to read offline
Mobile web development
techniques and Opera’s
developer tools.

                       dreas
                    An ens r Relations
                    Bopveader Develope
                      u L
                     Gro               e
                                   Phon
Andreas
Bovens
Group Leader Developer Relations


Opera Software ASA              Phone:      +47 23 69 26 68
Waldemar Thranes gate 98        Fax:        +47 23 69 24 01
P.O. Box 2648, St. Hanshaugen   Mobile:     +47 40 03 48 59
0131 Oslo                       E-mail:     andreasb@opera.com
Norway                          Web site:   www.opera.com
“Mobile web development”
Before:
WML, XHTML-MP, XHTML basic,
cHTML, i-HTML ...
                  CC by-nc 2.0 Jaime Pérez http://www.flickr.com/photos/jaimeperez/2562068910/
Before:
WML, XHTML-MP, XHTML basic,
cHTML, i-HTML ...
Mobile browser landscape has
changed dramatically
                     CC by 2.0 Magnera http://www.flickr.com/photos/magnera/4571460751/
Mobile browsers can deal with
“desktop” content just fine :-)
Small Screen Rendering
zoom and pan
...
top notch standards support
more powerful devices
faster connections
“Mobile web development”
“Mobile web development”
             =
normal web development +
mobile specific techniques
Three approaches
to catering for mobile users
1. Do nothing
1. Do nothing
   (or at least not too much)
1. Do nothing
             (or at least not too much)



                                liquid layout
semi-liquid layout
2. Create a separate mobile site
navigation
navigation




mysite.com   m.mysite.com
navigation


      UserAgent sniffing
mysite.com          m.mysite.com
navigation


      UserAgent sniffing
mysite.com                      m.mysite.com




                 CC by-nc-sa 2.0 Tim Dorr http://www.flickr.com/photos/timdorr/2096272747/
navigation


      UserAgent sniffing
mysite.com          m.mysite.com
navigation


       UserAgent sniffing
mysite.com           m.mysite.com


m.mysite.com               mysite.com
navigation


       UserAgent sniffing
mysite.com           m.mysite.com


m.mysite.com               mysite.com

                set cookie
navigation


check cookie, else UserAgent sniffing
  mysite.com            m.mysite.com


  m.mysite.com             mysite.com

                   set cookie
page layout
page layout




Use normal HTML
page layout




             Use normal HTML


Control zoom level with the viewport meta tag
Control zoom level with the viewport meta tag




                  No viewport meta tag:
                  viewport width is interpreted
                  as 850px, and squeezed
                  inside browser width
Control zoom level with the viewport meta tag




                  No viewport meta tag:
                  viewport width is interpreted
                  as 850px, and horizontal
                  panning is required
Control zoom level with the viewport meta tag




                  With viewport meta tag:
                  set value is taken as viewport
                  width, and then fit inside
                  browser width
Control zoom level with the viewport meta tag



                  <meta name="viewport"
                  content="width=320">
Control zoom level with the viewport meta tag



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


                  <meta name="viewport"
                  content="width=device-width">
Control zoom level with the viewport meta tag



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


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



                      makes browser behave
                      like there is no zoom
page layout




             Use normal HTML


Control zoom level with the viewport meta tag
navigation


check cookie, else UserAgent sniffing
  mysite.com            m.mysite.com


  m.mysite.com             mysite.com

                   set cookie
3. Create one site that works everywhere
3. Create one site that works everywhere

  viewport meta tag
3. Create one site that works everywhere

  viewport meta tag
                       media queries
media queries
media queries

@media screen and (max-width: 400px) {
/* CSS for browser widths smaller than 400px */
#nav {margin: 0}
#ad {display: none;}
}
@media screen and (min-width: 401px) and (max-width: 800px) {
/* CSS for browser widths between 401 and 800px */
#ad {float: left}
#content {padding: 5px;}
}
...
media queries

@media screen and (max-width: 400px) {
/* CSS for browser widths smaller than 400px */
#nav {margin: 0}
#ad {display: none;}
}
@media screen and (min-width: 401px) and (max-width: 800px) {
/* CSS for browser widths between 401 and 800px */
#ad {float: left}
#content {padding: 5px;}
}
...
different layouts for all
media queries
                kinds of browser sizes
different layouts for all
  media queries
                       kinds of browser sizes

What about mobile browsers with a virtual
width of e.g. 850px?
different layouts for all
  media queries
                       kinds of browser sizes

What about mobile browsers with a virtual
width of e.g. 850px?

 viewport meta tag     to the rescue!
media queries      max/min-width
                    relates directly to the
viewport meta tag   viewport width value
media queries              max/min-width
                               relates directly to the
  viewport meta tag            viewport width value

                                    e.g. Nokia 5800: 360px

<meta name="viewport" content="width=device-width">
...
@media screen and (max-width: 360px) {
/* CSS for browser widths smaller than 360px */
#nav {margin: 0}
#ad {display: none;}
}
...
1. Do nothing
2. Create a separate mobile site
3. Create one site that works everywhere
1. Do nothing
2. Create a separate mobile site
3. Create one site that works everywhere
             “holy grail”
How to reach the one site holy grail?
How to reach the one site holy grail?

•keep mobile in mind from the very start
How to reach the one site holy grail?

•keep mobile in mind from the very start
•resist the “mobile context” argument, and
 use it the other way around: simplify
 your desktop layout and content
How to reach the one site holy grail?

•keep mobile in mind from the very start
•resist the “mobile context” argument, and
 use it the other way around: simplify
 your desktop layout and content
•reduce the number of HTTP requests
and now: tools!
           (live demo)
http://www.opera.com/developer/tools/

More Related Content

What's hot

HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationHTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
Todd Anglin
 
Nuovi Scenari di Sviluppo: il Mondo degli Ebook
Nuovi Scenari di Sviluppo: il Mondo degli EbookNuovi Scenari di Sviluppo: il Mondo degli Ebook
Nuovi Scenari di Sviluppo: il Mondo degli Ebook
Giacomo D'Angelo
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
sagaroceanic11
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
James Pearce
 
HTML5: a quick overview
HTML5: a quick overviewHTML5: a quick overview
HTML5: a quick overview
Mark Whitaker
 

What's hot (20)

Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Html5 CSS3 jQuery Basic
Html5 CSS3 jQuery BasicHtml5 CSS3 jQuery Basic
Html5 CSS3 jQuery Basic
 
HTML5, CSS3, and JavaScript
HTML5, CSS3, and JavaScriptHTML5, CSS3, and JavaScript
HTML5, CSS3, and JavaScript
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationHTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
 
Bruce Lawson Opera Indonesia
Bruce Lawson Opera IndonesiaBruce Lawson Opera Indonesia
Bruce Lawson Opera Indonesia
 
Nuovi Scenari di Sviluppo: il Mondo degli Ebook
Nuovi Scenari di Sviluppo: il Mondo degli EbookNuovi Scenari di Sviluppo: il Mondo degli Ebook
Nuovi Scenari di Sviluppo: il Mondo degli Ebook
 
Design Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGapDesign Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGap
 
3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
 
Mobile Web Development
Mobile Web DevelopmentMobile Web Development
Mobile Web Development
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
 
A Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionA Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 Revolution
 
Building Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsBuilding Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web Apps
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
Amp by Google: The Present And Future Of Quick Content Delivery
Amp by Google: The Present And Future Of Quick Content DeliveryAmp by Google: The Present And Future Of Quick Content Delivery
Amp by Google: The Present And Future Of Quick Content Delivery
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
HTML5: a quick overview
HTML5: a quick overviewHTML5: a quick overview
HTML5: a quick overview
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 

Similar to Mobile web development techniques (and Opera's developer tools)

How to Develop Responsive Websites - Website Development
How to Develop Responsive Websites - Website DevelopmentHow to Develop Responsive Websites - Website Development
How to Develop Responsive Websites - Website Development
Mukesoft - IT Consultants
 
Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...
Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...
Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...
Patrick Lauke
 
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Patrick Lauke
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
betabeers
 
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 SlidesGDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
Heather Rock
 
Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3
Zoe Gillenwater
 
CSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for MobileCSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for Mobile
ambientphoto
 
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Patrick Lauke
 

Similar to Mobile web development techniques (and Opera's developer tools) (20)

Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
 
Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011
 
How to Develop Responsive Websites - Website Development
How to Develop Responsive Websites - Website DevelopmentHow to Develop Responsive Websites - Website Development
How to Develop Responsive Websites - Website Development
 
Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...
Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...
Handys und Tablets - Webentwicklung jenseits des Desktops - MobileTech Confer...
 
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
 
Mobile for web developers
Mobile for web developersMobile for web developers
Mobile for web developers
 
Responsive Web Design in iMIS (NiUG Austin 2015)
Responsive Web Design in iMIS (NiUG Austin 2015)Responsive Web Design in iMIS (NiUG Austin 2015)
Responsive Web Design in iMIS (NiUG Austin 2015)
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
 
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 SlidesGDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3Effective and Efficient Design with CSS3
Effective and Efficient Design with CSS3
 
CSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for MobileCSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for Mobile
 
Advancio, Inc. Academy: Responsive Web Design
Advancio, Inc. Academy: Responsive Web DesignAdvancio, Inc. Academy: Responsive Web Design
Advancio, Inc. Academy: Responsive Web Design
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
Bruce lawson-over-the-air
Bruce lawson-over-the-airBruce lawson-over-the-air
Bruce lawson-over-the-air
 
Links and Widgets: the Fabric of the Web
Links and Widgets: the Fabric of the WebLinks and Widgets: the Fabric of the Web
Links and Widgets: the Fabric of the Web
 
Intro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresIntro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS features
 

More from Andreas Bovens

More from Andreas Bovens (7)

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

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Mobile web development techniques (and Opera's developer tools)

  • 1. Mobile web development techniques and Opera’s developer tools. dreas An ens r Relations Bopveader Develope u L Gro e Phon
  • 2. Andreas Bovens Group Leader Developer Relations Opera Software ASA Phone: +47 23 69 26 68 Waldemar Thranes gate 98 Fax: +47 23 69 24 01 P.O. Box 2648, St. Hanshaugen Mobile: +47 40 03 48 59 0131 Oslo E-mail: andreasb@opera.com Norway Web site: www.opera.com
  • 3.
  • 4.
  • 5.
  • 6.
  • 8. Before: WML, XHTML-MP, XHTML basic, cHTML, i-HTML ... CC by-nc 2.0 Jaime Pérez http://www.flickr.com/photos/jaimeperez/2562068910/
  • 9. Before: WML, XHTML-MP, XHTML basic, cHTML, i-HTML ...
  • 10. Mobile browser landscape has changed dramatically CC by 2.0 Magnera http://www.flickr.com/photos/magnera/4571460751/
  • 11. Mobile browsers can deal with “desktop” content just fine :-)
  • 14. ... top notch standards support more powerful devices faster connections
  • 16. “Mobile web development” = normal web development + mobile specific techniques
  • 17. Three approaches to catering for mobile users
  • 19. 1. Do nothing (or at least not too much)
  • 20. 1. Do nothing (or at least not too much) liquid layout semi-liquid layout
  • 21. 2. Create a separate mobile site
  • 23. navigation mysite.com m.mysite.com
  • 24. navigation UserAgent sniffing mysite.com m.mysite.com
  • 25. navigation UserAgent sniffing mysite.com m.mysite.com CC by-nc-sa 2.0 Tim Dorr http://www.flickr.com/photos/timdorr/2096272747/
  • 26. navigation UserAgent sniffing mysite.com m.mysite.com
  • 27. navigation UserAgent sniffing mysite.com m.mysite.com m.mysite.com mysite.com
  • 28. navigation UserAgent sniffing mysite.com m.mysite.com m.mysite.com mysite.com set cookie
  • 29. navigation check cookie, else UserAgent sniffing mysite.com m.mysite.com m.mysite.com mysite.com set cookie
  • 32. page layout Use normal HTML Control zoom level with the viewport meta tag
  • 33. Control zoom level with the viewport meta tag No viewport meta tag: viewport width is interpreted as 850px, and squeezed inside browser width
  • 34. Control zoom level with the viewport meta tag No viewport meta tag: viewport width is interpreted as 850px, and horizontal panning is required
  • 35. Control zoom level with the viewport meta tag With viewport meta tag: set value is taken as viewport width, and then fit inside browser width
  • 36. Control zoom level with the viewport meta tag <meta name="viewport" content="width=320">
  • 37. Control zoom level with the viewport meta tag <meta name="viewport" content="width=320"> <meta name="viewport" content="width=device-width">
  • 38. Control zoom level with the viewport meta tag <meta name="viewport" content="width=320"> <meta name="viewport" content="width=device-width"> makes browser behave like there is no zoom
  • 39. page layout Use normal HTML Control zoom level with the viewport meta tag
  • 40. navigation check cookie, else UserAgent sniffing mysite.com m.mysite.com m.mysite.com mysite.com set cookie
  • 41. 3. Create one site that works everywhere
  • 42. 3. Create one site that works everywhere viewport meta tag
  • 43. 3. Create one site that works everywhere viewport meta tag media queries
  • 45. media queries @media screen and (max-width: 400px) { /* CSS for browser widths smaller than 400px */ #nav {margin: 0} #ad {display: none;} } @media screen and (min-width: 401px) and (max-width: 800px) { /* CSS for browser widths between 401 and 800px */ #ad {float: left} #content {padding: 5px;} } ...
  • 46. media queries @media screen and (max-width: 400px) { /* CSS for browser widths smaller than 400px */ #nav {margin: 0} #ad {display: none;} } @media screen and (min-width: 401px) and (max-width: 800px) { /* CSS for browser widths between 401 and 800px */ #ad {float: left} #content {padding: 5px;} } ...
  • 47. different layouts for all media queries kinds of browser sizes
  • 48. different layouts for all media queries kinds of browser sizes What about mobile browsers with a virtual width of e.g. 850px?
  • 49. different layouts for all media queries kinds of browser sizes What about mobile browsers with a virtual width of e.g. 850px? viewport meta tag to the rescue!
  • 50. media queries max/min-width relates directly to the viewport meta tag viewport width value
  • 51. media queries max/min-width relates directly to the viewport meta tag viewport width value e.g. Nokia 5800: 360px <meta name="viewport" content="width=device-width"> ... @media screen and (max-width: 360px) { /* CSS for browser widths smaller than 360px */ #nav {margin: 0} #ad {display: none;} } ...
  • 52. 1. Do nothing 2. Create a separate mobile site 3. Create one site that works everywhere
  • 53. 1. Do nothing 2. Create a separate mobile site 3. Create one site that works everywhere “holy grail”
  • 54. How to reach the one site holy grail?
  • 55. How to reach the one site holy grail? •keep mobile in mind from the very start
  • 56. How to reach the one site holy grail? •keep mobile in mind from the very start •resist the “mobile context” argument, and use it the other way around: simplify your desktop layout and content
  • 57. How to reach the one site holy grail? •keep mobile in mind from the very start •resist the “mobile context” argument, and use it the other way around: simplify your desktop layout and content •reduce the number of HTTP requests
  • 58. and now: tools! (live demo) http://www.opera.com/developer/tools/