SlideShare uma empresa Scribd logo
1 de 29
MAKING YOUR SITE IPHONE-FRIENDLY
             Dori Smith
What I mean by iPhone-friendly




❖   You don’t have to double-tap just to read it
❖   Everything you want to do, you can do
Who are you?


❖   HTML — yes
❖   CSS — mostly
❖   JavaScript — maybe
Who are you?



Someone who doesn’t want to maintain an entire
           duplicate mobile site
iPhone-friendly & iPhone-savvy



❖   Friendly
    ❖   You can accomplish your goal
❖   Savvy
    ❖   You can accomplish your goal, intuitively
Why make your site
    work with the iPhone?


❖   A big market
❖   Getting bigger all the time
Who’s the Market?
          Oceania

Western Europe

  North America

   Latin America

 Eastern Europe

               Asia

             Africa

                                      20            40             60             80    100


    iPhone                      Android                       Palm Pre
Smartphone OS Share by region based on ad requests, December 2009 — metrics.admob.com
Starting off

❖   You have a site
    ❖   Content
    ❖   Menu
    ❖   Header
    ❖   Footer
Starting off


❖   You have a site
    ❖   Fixed width or fluid?
    ❖   Side or top navigation?
Starting off


❖   You have a site
    ❖   Fixed width or fluid
    ❖   Side or top navigation?
Starting off


❖   You have a site
    ❖   Fixed width or fluid
    ❖   Side or top navigation
How the world sees the iPhone

❖   Portrait
    ❖   320 px wide by 356 px high
    ❖   320 px wide by 140 px high with keyboard
❖   Landscape
    ❖   480 px wide by 208 px high
    ❖   480 px wide by 46 px high with keyboard
How the iPhone sees the world




          The “Viewport”
The Viewport


❖   Default is 980 px wide
❖   You need to say how wide your site actually is
    ❖   Via HTML’s “<meta>” tag
The Viewport
❖   Apple says

    <meta name = "viewport"
    content = "width = device-width" />
❖   Another approach

    <meta name = "viewport"
    content = "width = 560" />
❖   Just play with it
Custom CSS

❖   One magic line of HTML

    <link rel="stylesheet"
    href="iphone.css" type="text/css"
    media="only screen and
    (max-device-width:480px)" />
❖   Then add your styles to the custom CSS file
Custom CSS


#container {

  font-size: .8em;

  width: 100%;
}
Custom CSS



#navbar {

  font-weight: normal;
}
Custom CSS


h1, h2, h3, h4, h5, h6 {

   font-family: Georgia, "Times New Roman",
serif;
}
Custom JavaScript

addEventListener(

    'load',

    function() {

    
 setTimeout(scrollTo, 0, 0, 1);
   
 },

    false
);
Custom JavaScript
addEventListener(

  'orientationchange',

  function() {

     var classVal = (Math.abs
       (window.orientation)==90) ?
       "landscape" : "portrait";

     document.getElementById("container").
       setAttribute("class", classVal);

     setTimeout(scrollTo, 0, 0, 1);

  },

  false
);
Custom CSS

.landscape {

   font-size: .5em;
}



.portrait {

   font-size: .8em;
}
iPhone-savvy


❖   Smarter forms
❖   Smarter graphics
❖   Smarter responses
Data Entry
Text       <input type="text" />

Telephone <input type="tel" />

URL        <input type="url" />

Email      <input type="email" />

           <input type="text"
Zip Code
             pattern="[0-9]*" />
An Icon of Your Own

❖   Create a square graphic
    ❖   No need to be fancy
❖   Name it apple-touch-icon.png
❖   Put it in your root directory
Getting Out in the
            World
mailto            Launches Mail

tel               Calls a phone number

sms               Launches Messages

maps.google.com   Launches Google maps

www.youtube.com Launches YouTube
Examples

<p>Call us: <a href="tel:
1-707-555-1212">1-707-555-1212</a></
p>

<p>Visit us: <a href="http://maps.google.com/
maps?ll=38.61,-122.87&z=16">Find us on the
map</a></p>
Going Forward

❖   CSS 3
    ❖   Gradients
    ❖   Animations
❖   HTML 5
    ❖   Video, and more...
Tell Me Your Tips

Mais conteúdo relacionado

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Making Your Site iPhone Friendly

  • 1. MAKING YOUR SITE IPHONE-FRIENDLY Dori Smith
  • 2. What I mean by iPhone-friendly ❖ You don’t have to double-tap just to read it ❖ Everything you want to do, you can do
  • 3. Who are you? ❖ HTML — yes ❖ CSS — mostly ❖ JavaScript — maybe
  • 4. Who are you? Someone who doesn’t want to maintain an entire duplicate mobile site
  • 5. iPhone-friendly & iPhone-savvy ❖ Friendly ❖ You can accomplish your goal ❖ Savvy ❖ You can accomplish your goal, intuitively
  • 6. Why make your site work with the iPhone? ❖ A big market ❖ Getting bigger all the time
  • 7. Who’s the Market? Oceania Western Europe North America Latin America Eastern Europe Asia Africa 20 40 60 80 100 iPhone Android Palm Pre Smartphone OS Share by region based on ad requests, December 2009 — metrics.admob.com
  • 8. Starting off ❖ You have a site ❖ Content ❖ Menu ❖ Header ❖ Footer
  • 9. Starting off ❖ You have a site ❖ Fixed width or fluid? ❖ Side or top navigation?
  • 10. Starting off ❖ You have a site ❖ Fixed width or fluid ❖ Side or top navigation?
  • 11. Starting off ❖ You have a site ❖ Fixed width or fluid ❖ Side or top navigation
  • 12. How the world sees the iPhone ❖ Portrait ❖ 320 px wide by 356 px high ❖ 320 px wide by 140 px high with keyboard ❖ Landscape ❖ 480 px wide by 208 px high ❖ 480 px wide by 46 px high with keyboard
  • 13. How the iPhone sees the world The “Viewport”
  • 14. The Viewport ❖ Default is 980 px wide ❖ You need to say how wide your site actually is ❖ Via HTML’s “<meta>” tag
  • 15. The Viewport ❖ Apple says <meta name = "viewport" content = "width = device-width" /> ❖ Another approach <meta name = "viewport" content = "width = 560" /> ❖ Just play with it
  • 16. Custom CSS ❖ One magic line of HTML <link rel="stylesheet" href="iphone.css" type="text/css" media="only screen and (max-device-width:480px)" /> ❖ Then add your styles to the custom CSS file
  • 17. Custom CSS #container { font-size: .8em; width: 100%; }
  • 18. Custom CSS #navbar { font-weight: normal; }
  • 19. Custom CSS h1, h2, h3, h4, h5, h6 { font-family: Georgia, "Times New Roman", serif; }
  • 20. Custom JavaScript addEventListener( 'load', function() { setTimeout(scrollTo, 0, 0, 1);     }, false );
  • 21. Custom JavaScript addEventListener( 'orientationchange', function() { var classVal = (Math.abs (window.orientation)==90) ? "landscape" : "portrait"; document.getElementById("container"). setAttribute("class", classVal); setTimeout(scrollTo, 0, 0, 1); }, false );
  • 22. Custom CSS .landscape { font-size: .5em; } .portrait { font-size: .8em; }
  • 23. iPhone-savvy ❖ Smarter forms ❖ Smarter graphics ❖ Smarter responses
  • 24. Data Entry Text <input type="text" /> Telephone <input type="tel" /> URL <input type="url" /> Email <input type="email" /> <input type="text" Zip Code pattern="[0-9]*" />
  • 25. An Icon of Your Own ❖ Create a square graphic ❖ No need to be fancy ❖ Name it apple-touch-icon.png ❖ Put it in your root directory
  • 26. Getting Out in the World mailto Launches Mail tel Calls a phone number sms Launches Messages maps.google.com Launches Google maps www.youtube.com Launches YouTube
  • 27. Examples <p>Call us: <a href="tel: 1-707-555-1212">1-707-555-1212</a></ p> <p>Visit us: <a href="http://maps.google.com/ maps?ll=38.61,-122.87&z=16">Find us on the map</a></p>
  • 28. Going Forward ❖ CSS 3 ❖ Gradients ❖ Animations ❖ HTML 5 ❖ Video, and more...
  • 29. Tell Me Your Tips