SlideShare a Scribd company logo
MEDIA QUERIES, USER-AGENTS, AND USER OPT-IN, OH MY!

BUILDING MOBILE WEBSITES

                   Shoshi Roberts
                     @shoshizilla
WAYS TO BUILD YOUR MOBILE SITE


1) Detect the User-Agent String and redirect to a mobile site

2) Media Queries (aka. Responsive Design)

3) User Opt-in Link
MOBILE WEBSITES VS. APPS:
                      WHY HAVE A MOBILE SITE?


• Mobile   sites get 10% of all web traffic (stats from 2009, it’s higher now)

• 25% of internet users in the US only browse on mobile
 devices (this is low on a global scale, it’s 70% in Egypt)

• 40%   of tweets are sent from mobile devices (both site and app)

• Some   user flows will send you to the mobile site anyhow...
EXAMPLE FROM TWITTER
User gets an email:        User clicks on the link and goes to:
You have a new follower!   mobile.twitter.com/
MOBILE WEBSITES VS. APPS

                   Moral of the story:
Some people will need websites and some will need apps.
                 You usually want both.
              Use your best judgement.
                 We want happy users.

     You’re a good candidate for an app if you need:
        location data, games, offline functionality
USING USER-AGENT STRING
BENEFITS
• Entirely   optimize your site for mobile

• Provide    tailored Content just for mobile users

• Allows     you to build features for specific mobile needs


DRAWBACKS
• Separate     from your desktop site, possible lack of continuity
USING USER-AGENT STRING
APACHE CONFIG (.htaccess)

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} (OneMobileUserAgent|
  AnotherMobileUserAgent|YouSeeWhereThisGoes...)
RewriteRule ^$ http://mobile.example.com/ [R,L]



FOR RAILS, PYTHON, PERL, ASP, PHP, JS,NGINX...
http://detectmobilebrowsers.com/
USING MEDIA QUERIES
BENEFITS
• Makes your site look great at all screen sizes (desktop/
 tablet/mobile)

• Unified   content across all platforms


DRAWBACKS
• More complicated to have custom content or special
 features on mobile site
USING MEDIA QUERIES
SINGLE CSS FILE
@media screen and (min-device-width: 769px) {
   div.example {
     width: 30%;  /* 3 columns for desktop */
   }
}
@media screen and (min-device-width: 481px) and
                  (max-device-width: 768px) {
  div.example {
     width: 50%;  /* 2 columns for tablets and netbooks */
   }
}
@media screen and (max-device-width: 480px) {
  div.example {
     width: 100%; /* 1 column for mobile */
   }
}
USING MEDIA QUERIES
MULTIPLE CSS FILES (put this HTML in <head>)
<meta name="viewport" content="width=device-width,
      initial-scale=1.0">

<link rel="stylesheet"
      href="styles.css"> <!-- for global styles -->
<link rel="stylesheet"
      media="screen and (min-device-width: 769px)"
      href="desktop.css">
<link rel="stylesheet"
      media="screen and (min-device-width: 481px) and
             (max-device-width: 768px)"
      href="tablet.css">
<link rel="stylesheet"
      media="screen and (max-device-width: 480px)"
      href="mobile.css">
USING MEDIA QUERIES




       DESKTOP
USING MEDIA QUERIES




  TABLET      MOBILE
USING USER OPT-IN
BENEFITS
• User   sees the desktop site they know and love

• User   gets to choose which version to see

DRAWBACKS
• User may leave because of a poor experience before the
 click on the “mobile version” or even “download app” link
USING USER OPT-IN
MAKE A LINK!
<a href=”http://mobile.example.com/”>Mobile Site</a>

<a href=”http://example.com/mobile/”>Mobile Site</a>



MAKE IT FANCY
• UseJS or another framework to detect the user-agent
 and provide a banner at the top of the page

• NOTE:This can be effective if used the opposite way:
 “Want to see the desktop version? Click here.”
WRAPPING IT UP

• Responsive   Design is easy to incorporate now

• Usemobile site redirects (with the User-Agent string) when
 you want to use different functionality and design

• Make   it easy for the user no matter how they visit your site

• Consider   your user’s desires, and use your best judgement
THANKS
        AND HAPPY HACKING!




  @shoshizilla for @ladieswhocode
Special Thanks to @mintdigital for hosting

More Related Content

What's hot

Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
Tim Wright
 
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhone
Brian Shim
 
Creating a Balanced UX Workflow
Creating a Balanced UX WorkflowCreating a Balanced UX Workflow
Creating a Balanced UX Workflow
Jason Beaird
 
Navigation guidelines on Windows Modern UI
Navigation guidelines on Windows Modern UINavigation guidelines on Windows Modern UI
Navigation guidelines on Windows Modern UI
Maria Nasioti
 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
Sencha
 
Responsive Navigation Patterns, UX and Guidelines
Responsive Navigation Patterns, UX and GuidelinesResponsive Navigation Patterns, UX and Guidelines
Responsive Navigation Patterns, UX and Guidelines
Peter Rozek
 
Big Brands, Mobile SEO and You by John Shehata - #SEJSummit New York City
Big Brands, Mobile SEO and You by John Shehata - #SEJSummit New York CityBig Brands, Mobile SEO and You by John Shehata - #SEJSummit New York City
Big Brands, Mobile SEO and You by John Shehata - #SEJSummit New York City
Search Engine Journal
 
Mobile site options
Mobile site optionsMobile site options
Mobile site options
January Kohli
 
Building native apps with web components
Building native apps with web componentsBuilding native apps with web components
Building native apps with web components
Denis Radin
 
Responsive Design
Responsive DesignResponsive Design
Responsive Design
DheerajPachauri
 
Expertise In Mobile SEO
Expertise In Mobile SEOExpertise In Mobile SEO
Expertise In Mobile SEO
Nimap Infotech
 
Mobile Web - Merging responsive and adaptive techniques
Mobile Web - Merging responsive and adaptive techniquesMobile Web - Merging responsive and adaptive techniques
Mobile Web - Merging responsive and adaptive techniques
Francisco Ferreira
 
Facebook Timeline - Implications & Strategy
Facebook Timeline - Implications & StrategyFacebook Timeline - Implications & Strategy
Facebook Timeline - Implications & Strategy
Joey Barker
 
Mobile Optimization
Mobile OptimizationMobile Optimization
Mobile Optimization
Rachel Fredrickson
 
Mobile JS Frameworks
Mobile JS FrameworksMobile JS Frameworks
Mobile JS Frameworks
Ibrahim Ersoy
 

What's hot (16)

Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhone
 
Creating a Balanced UX Workflow
Creating a Balanced UX WorkflowCreating a Balanced UX Workflow
Creating a Balanced UX Workflow
 
Navigation guidelines on Windows Modern UI
Navigation guidelines on Windows Modern UINavigation guidelines on Windows Modern UI
Navigation guidelines on Windows Modern UI
 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
 
Responsive Navigation Patterns, UX and Guidelines
Responsive Navigation Patterns, UX and GuidelinesResponsive Navigation Patterns, UX and Guidelines
Responsive Navigation Patterns, UX and Guidelines
 
Big Brands, Mobile SEO and You by John Shehata - #SEJSummit New York City
Big Brands, Mobile SEO and You by John Shehata - #SEJSummit New York CityBig Brands, Mobile SEO and You by John Shehata - #SEJSummit New York City
Big Brands, Mobile SEO and You by John Shehata - #SEJSummit New York City
 
Mobile site options
Mobile site optionsMobile site options
Mobile site options
 
Building native apps with web components
Building native apps with web componentsBuilding native apps with web components
Building native apps with web components
 
Responsive Design
Responsive DesignResponsive Design
Responsive Design
 
Expertise In Mobile SEO
Expertise In Mobile SEOExpertise In Mobile SEO
Expertise In Mobile SEO
 
Sc open all hours final
Sc open all hours finalSc open all hours final
Sc open all hours final
 
Mobile Web - Merging responsive and adaptive techniques
Mobile Web - Merging responsive and adaptive techniquesMobile Web - Merging responsive and adaptive techniques
Mobile Web - Merging responsive and adaptive techniques
 
Facebook Timeline - Implications & Strategy
Facebook Timeline - Implications & StrategyFacebook Timeline - Implications & Strategy
Facebook Timeline - Implications & Strategy
 
Mobile Optimization
Mobile OptimizationMobile Optimization
Mobile Optimization
 
Mobile JS Frameworks
Mobile JS FrameworksMobile JS Frameworks
Mobile JS Frameworks
 

Similar to Building Mobile Websites

Best Practices for Mobile Web Design
Best Practices for Mobile Web DesignBest Practices for Mobile Web Design
Best Practices for Mobile Web Design
St. Petersburg College
 
Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...
Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...
Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...
Conductor
 
Advanced Mobile SEO - John Shehata - C3 2014
Advanced Mobile SEO - John Shehata - C3 2014Advanced Mobile SEO - John Shehata - C3 2014
Advanced Mobile SEO - John Shehata - C3 2014
John Shehata
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
Ambert Ho
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
Julia Vi
 
Breaking The Broken Web
Breaking The Broken WebBreaking The Broken Web
Breaking The Broken Web
FITC
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
Ron Reiter
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)
Tirthesh Ganatra
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
Mike Wilcox
 
Mobile SEO Considerations
Mobile SEO ConsiderationsMobile SEO Considerations
Mobile SEO Considerations
Reva McPollom
 
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Jack Zheng
 
Mobile web development
Mobile web development Mobile web development
Mobile web development
Moumie Soulemane
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?
Henny Swan
 
Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
Antonio Peric-Mazar
 
20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua
Юлия Коваленко
 
Mobilism 2011: How to put the mobile in the mobile web
Mobilism 2011: How to put the mobile in the mobile webMobilism 2011: How to put the mobile in the mobile web
Mobilism 2011: How to put the mobile in the mobile web
Jenifer Hanen
 
Responsive & Adaptive Design: Delivering Websites That Delight Your Users
Responsive & Adaptive Design: Delivering Websites That Delight Your UsersResponsive & Adaptive Design: Delivering Websites That Delight Your Users
Responsive & Adaptive Design: Delivering Websites That Delight Your Users
BBDO
 
A year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMUA year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMU
Antonio Peric-Mazar
 
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive UX - One size fits all   @BigDesign conference #BigD12Responsive UX - One size fits all   @BigDesign conference #BigD12
Responsive UX - One size fits all @BigDesign conference #BigD12touchtitans
 

Similar to Building Mobile Websites (20)

Best Practices for Mobile Web Design
Best Practices for Mobile Web DesignBest Practices for Mobile Web Design
Best Practices for Mobile Web Design
 
Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...
Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...
Why Mobile, Why Now? | John Shehata – Executive Director of Search & Social M...
 
Advanced Mobile SEO - John Shehata - C3 2014
Advanced Mobile SEO - John Shehata - C3 2014Advanced Mobile SEO - John Shehata - C3 2014
Advanced Mobile SEO - John Shehata - C3 2014
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Breaking The Broken Web
Breaking The Broken WebBreaking The Broken Web
Breaking The Broken Web
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Mobile SEO Considerations
Mobile SEO ConsiderationsMobile SEO Considerations
Mobile SEO Considerations
 
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
 
Mobile web development
Mobile web development Mobile web development
Mobile web development
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?
 
Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
 
20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua
 
Mobilism 2011: How to put the mobile in the mobile web
Mobilism 2011: How to put the mobile in the mobile webMobilism 2011: How to put the mobile in the mobile web
Mobilism 2011: How to put the mobile in the mobile web
 
Responsive & Adaptive Design: Delivering Websites That Delight Your Users
Responsive & Adaptive Design: Delivering Websites That Delight Your UsersResponsive & Adaptive Design: Delivering Websites That Delight Your Users
Responsive & Adaptive Design: Delivering Websites That Delight Your Users
 
Simple mobile Websites
Simple mobile WebsitesSimple mobile Websites
Simple mobile Websites
 
A year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMUA year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMU
 
Responsive UX - One size fits all @BigDesign conference #BigD12
Responsive UX - One size fits all   @BigDesign conference #BigD12Responsive UX - One size fits all   @BigDesign conference #BigD12
Responsive UX - One size fits all @BigDesign conference #BigD12
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 

Building Mobile Websites

  • 1. MEDIA QUERIES, USER-AGENTS, AND USER OPT-IN, OH MY! BUILDING MOBILE WEBSITES Shoshi Roberts @shoshizilla
  • 2. WAYS TO BUILD YOUR MOBILE SITE 1) Detect the User-Agent String and redirect to a mobile site 2) Media Queries (aka. Responsive Design) 3) User Opt-in Link
  • 3. MOBILE WEBSITES VS. APPS: WHY HAVE A MOBILE SITE? • Mobile sites get 10% of all web traffic (stats from 2009, it’s higher now) • 25% of internet users in the US only browse on mobile devices (this is low on a global scale, it’s 70% in Egypt) • 40% of tweets are sent from mobile devices (both site and app) • Some user flows will send you to the mobile site anyhow...
  • 4. EXAMPLE FROM TWITTER User gets an email: User clicks on the link and goes to: You have a new follower! mobile.twitter.com/
  • 5. MOBILE WEBSITES VS. APPS Moral of the story: Some people will need websites and some will need apps. You usually want both. Use your best judgement. We want happy users. You’re a good candidate for an app if you need: location data, games, offline functionality
  • 6. USING USER-AGENT STRING BENEFITS • Entirely optimize your site for mobile • Provide tailored Content just for mobile users • Allows you to build features for specific mobile needs DRAWBACKS • Separate from your desktop site, possible lack of continuity
  • 7. USING USER-AGENT STRING APACHE CONFIG (.htaccess) RewriteEngine On RewriteCond %{HTTP_USER_AGENT} (OneMobileUserAgent| AnotherMobileUserAgent|YouSeeWhereThisGoes...) RewriteRule ^$ http://mobile.example.com/ [R,L] FOR RAILS, PYTHON, PERL, ASP, PHP, JS,NGINX... http://detectmobilebrowsers.com/
  • 8. USING MEDIA QUERIES BENEFITS • Makes your site look great at all screen sizes (desktop/ tablet/mobile) • Unified content across all platforms DRAWBACKS • More complicated to have custom content or special features on mobile site
  • 9. USING MEDIA QUERIES SINGLE CSS FILE @media screen and (min-device-width: 769px) { div.example { width: 30%; /* 3 columns for desktop */ } } @media screen and (min-device-width: 481px) and (max-device-width: 768px) { div.example { width: 50%; /* 2 columns for tablets and netbooks */ } } @media screen and (max-device-width: 480px) { div.example { width: 100%; /* 1 column for mobile */ } }
  • 10. USING MEDIA QUERIES MULTIPLE CSS FILES (put this HTML in <head>) <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <!-- for global styles --> <link rel="stylesheet" media="screen and (min-device-width: 769px)" href="desktop.css"> <link rel="stylesheet" media="screen and (min-device-width: 481px) and (max-device-width: 768px)" href="tablet.css"> <link rel="stylesheet" media="screen and (max-device-width: 480px)" href="mobile.css">
  • 12. USING MEDIA QUERIES TABLET MOBILE
  • 13. USING USER OPT-IN BENEFITS • User sees the desktop site they know and love • User gets to choose which version to see DRAWBACKS • User may leave because of a poor experience before the click on the “mobile version” or even “download app” link
  • 14. USING USER OPT-IN MAKE A LINK! <a href=”http://mobile.example.com/”>Mobile Site</a> <a href=”http://example.com/mobile/”>Mobile Site</a> MAKE IT FANCY • UseJS or another framework to detect the user-agent and provide a banner at the top of the page • NOTE:This can be effective if used the opposite way: “Want to see the desktop version? Click here.”
  • 15. WRAPPING IT UP • Responsive Design is easy to incorporate now • Usemobile site redirects (with the User-Agent string) when you want to use different functionality and design • Make it easy for the user no matter how they visit your site • Consider your user’s desires, and use your best judgement
  • 16. THANKS AND HAPPY HACKING! @shoshizilla for @ladieswhocode Special Thanks to @mintdigital for hosting