SlideShare uma empresa Scribd logo
1 de 37
CSS for Mobile
         Daniel Ryan
BarCamp Chattanooga, July 25, 2009
The Advent of iPhone


• Approximately 15% of all internet traffic is now
 from mobile platforms

• Of mobile browsers, Mobile Safari holds a 67%
 usage share
Mobile Platform Usage
 Mobile Safari                   Java ME                      Windows Mobile
 Android                         Symbian                      Palm
 Blackberry                      BREW


                     2%
                   2%
                 2%
            Symbian
              6%

         Android
          6%
                                                             Mobile Safari
                                                                66%
     Windows Mobile
          7%

                Java ME
                  9%




      Source: http://mobilitytoday.com/news/009360/safari_iphone_king_browser
Mobile Platform Usage
Mobile Platform Usage
Mobile Platform Usage
Webkit           Opera    IE   Palm        Blackberry
Other




                     1%
                    2%
                  2%
             IE
             7%



         Opera
         12%
                                  Webkit
                                   76%
Two Approaches
Two Approaches



• Separate Style Sheet
Two Approaches



• Separate Style Sheet
• Additional rules in the same Style Sheet
Separate Style Sheet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    ...
    <link rel="stylesheet" href="/css/barcampchatt.css" type="text/css" />
    <link media="only screen and (max-device-width: 480px)" href="/css/
    mobile.css" type="text/css" rel="stylesheet" />
    ...
  </head>
Additional Rules
...
@media only screen and (max-device-width: 480px) {
    body { font-size: 17px; font-family: Helvetica, sans-serif; }

    a { color: #e2f7d8; }

    h1, h2, h3, h4, h5, h6 { font-weight: bold; font-size: 100% !important;
    color: #fff; font-family: inherit; }
}




                        Source: http://squaregirl.com/blog/2009/6/1/iphone-css.html
Additional Rules
...
@media only screen and (max-device-width: 480px) {
    body { font-size: 17px; font-family: Helvetica, sans-serif; }

    a { color: #e2f7d8; }

    h1, h2, h3, h4, h5, h6 { font-weight: bold; font-size: 100% !important;
    color: #fff; font-family: inherit; }
}
First Steps
First Steps
<meta name="viewport" content="width=device-width, initial-scale=1,
user-scalable=no" />
First Steps
<meta name="viewport" content="width=device-width, initial-scale=1,
user-scalable=no" />



body { font-size: 17px; font-family: Helvetica, sans-serif; }

#bd, #sb { float: none; }
Reusing Graphic Elements




      Source: http://www.css3.info/preview/background-size/
Reusing Graphic Elements
                    allows you to rescale an image
-webkit-background-size
without having to make a separate file. it accepts an x
and y value, with “auto” being acceptable for either.




                      Source: http://www.css3.info/preview/background-size/
Reusing Graphic Elements
                    allows you to rescale an image
-webkit-background-size
without having to make a separate file. it accepts an x
and y value, with “auto” being acceptable for either.

  #hd p.logo a { -webkit-background-size: auto 40px; }




                       Source: http://www.css3.info/preview/background-size/
Reducing Graphic Elements




Source: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
Reducing Graphic Elements
-webkit-gradient  allows you to have the browser draw
gradient backgrounds for you. It can be used anywhere
an url(‘../path/to/file’) can be used.




     Source: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
Reducing Graphic Elements
-webkit-gradient  allows you to have the browser draw
gradient backgrounds for you. It can be used anywhere
an url(‘../path/to/file’) can be used.

  #hd { background: -webkit-gradient(linear, center top, center bottom,
  from(rgba(0,0,0,0.5)), color-stop(0.1, #fff), to(#fff)); }




     Source: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
Reducing Graphic Elements
Reducing Graphic Elements
          allows you to have transparent color values. It
rgba(0,0,0,0)
can be used anywhere a color code can be used.
Reducing Graphic Elements
          allows you to have transparent color values. It
rgba(0,0,0,0)
can be used anywhere a color code can be used.

   #hd { background: rgba(0,0,0,0.5); }
Best Practices
Best Practices
•   Reduce the number of
    assets
Best Practices
•   Reduce the number of
    assets

•   Use CSS to replace
    assets where possible
Best Practices
•   Reduce the number of
    assets

•   Use CSS to replace
    assets where possible

•   Hide objects that the
    platform cannot view
Best Practices
•   Reduce the number of
    assets

•   Use CSS to replace
    assets where possible

•   Hide objects that the
    platform cannot view

•   Use native font faces and
    sizes
Best Practices
•   Reduce the number of        •   Reduce multicolumn
    assets                          layouts to single column

•   Use CSS to replace
    assets where possible

•   Hide objects that the
    platform cannot view

•   Use native font faces and
    sizes
Best Practices
•   Reduce the number of        •   Reduce multicolumn
    assets                          layouts to single column

•   Use CSS to replace          •   Visually reorder the page
    assets where possible           flow where applicable

•   Hide objects that the
    platform cannot view

•   Use native font faces and
    sizes
Best Practices
•   Reduce the number of        •   Reduce multicolumn
    assets                          layouts to single column

•   Use CSS to replace          •   Visually reorder the page
    assets where possible           flow where applicable

•   Hide objects that the       •   Use native-esque
    platform cannot view            controls

•   Use native font faces and
    sizes
Best Practices
•   Reduce the number of        •   Reduce multicolumn
    assets                          layouts to single column

•   Use CSS to replace          •   Visually reorder the page
    assets where possible           flow where applicable

•   Hide objects that the       •   Use native-esque
    platform cannot view            controls

•   Use native font faces and   •   Change any overflow: auto
    sizes                           elements to overflow:
                                    visible
Some Real World Examples
Some Real World Examples
Some Real World Examples
Additional Resources

                 http://developer.apple.com/safari/
                         http://webkit.org/
 http://www.alistapart.com/articles/return-of-the-mobile-stylesheet/
   http://www.alistapart.com/articles/putyourcontentinmypocket/
http://girliemac.com/blog/2008/07/19/webkit-css-animation-examples/
                  http://dryan.com/css-for-mobile
        http://www.slideshare.net/danielryan/css-for-mobile/

Mais conteúdo relacionado

Mais procurados

jQuery Mobile Introduction
jQuery Mobile IntroductionjQuery Mobile Introduction
jQuery Mobile IntroductionJoris Graaumans
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12ucbdrupal
 
The crusade for the Holy Grail layout - DublinJS Lightning Talk
The crusade for the Holy Grail layout - DublinJS Lightning TalkThe crusade for the Holy Grail layout - DublinJS Lightning Talk
The crusade for the Holy Grail layout - DublinJS Lightning TalkAdrian Sandu
 
Advanced Skinning & Styling for Android
Advanced Skinning & Styling for AndroidAdvanced Skinning & Styling for Android
Advanced Skinning & Styling for Androidcephus07
 
Put A Map On It! Enhanced geolocation in WordPress with Geo Mashup
Put A Map On It! Enhanced geolocation in WordPress with Geo MashupPut A Map On It! Enhanced geolocation in WordPress with Geo Mashup
Put A Map On It! Enhanced geolocation in WordPress with Geo MashupJer Clarke
 
CSS架構如何加速功能開發
CSS架構如何加速功能開發CSS架構如何加速功能開發
CSS架構如何加速功能開發Oliver Lin
 
"Wordpress for web designers. What, when, how, where" por @nuriarai
"Wordpress for web designers. What, when, how, where" por @nuriarai"Wordpress for web designers. What, when, how, where" por @nuriarai
"Wordpress for web designers. What, when, how, where" por @nuriaraiwebcat
 
Web Navigation Presentation
Web Navigation PresentationWeb Navigation Presentation
Web Navigation Presentationglvsav37
 
Building & Scaling a Front End Practice & Team
Building & Scaling a Front End Practice & TeamBuilding & Scaling a Front End Practice & Team
Building & Scaling a Front End Practice & TeamMonika Piotrowicz
 
Responsive Design
Responsive DesignResponsive Design
Responsive DesignAnna Bloom
 
WordPress: A Designer's CMS
WordPress: A Designer's CMSWordPress: A Designer's CMS
WordPress: A Designer's CMSChelsea Otakan
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 
Web Standards and Accessibility
Web Standards and AccessibilityWeb Standards and Accessibility
Web Standards and AccessibilityKarl Dawson
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando Gallego
 
Slides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks SitesSlides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks SitesMassimo Callisto
 

Mais procurados (16)

jQuery Mobile Introduction
jQuery Mobile IntroductionjQuery Mobile Introduction
jQuery Mobile Introduction
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
The crusade for the Holy Grail layout - DublinJS Lightning Talk
The crusade for the Holy Grail layout - DublinJS Lightning TalkThe crusade for the Holy Grail layout - DublinJS Lightning Talk
The crusade for the Holy Grail layout - DublinJS Lightning Talk
 
Advanced Skinning & Styling for Android
Advanced Skinning & Styling for AndroidAdvanced Skinning & Styling for Android
Advanced Skinning & Styling for Android
 
Put A Map On It! Enhanced geolocation in WordPress with Geo Mashup
Put A Map On It! Enhanced geolocation in WordPress with Geo MashupPut A Map On It! Enhanced geolocation in WordPress with Geo Mashup
Put A Map On It! Enhanced geolocation in WordPress with Geo Mashup
 
Emkane RCC wp qs
Emkane RCC wp qsEmkane RCC wp qs
Emkane RCC wp qs
 
CSS架構如何加速功能開發
CSS架構如何加速功能開發CSS架構如何加速功能開發
CSS架構如何加速功能開發
 
"Wordpress for web designers. What, when, how, where" por @nuriarai
"Wordpress for web designers. What, when, how, where" por @nuriarai"Wordpress for web designers. What, when, how, where" por @nuriarai
"Wordpress for web designers. What, when, how, where" por @nuriarai
 
Web Navigation Presentation
Web Navigation PresentationWeb Navigation Presentation
Web Navigation Presentation
 
Building & Scaling a Front End Practice & Team
Building & Scaling a Front End Practice & TeamBuilding & Scaling a Front End Practice & Team
Building & Scaling a Front End Practice & Team
 
Responsive Design
Responsive DesignResponsive Design
Responsive Design
 
WordPress: A Designer's CMS
WordPress: A Designer's CMSWordPress: A Designer's CMS
WordPress: A Designer's CMS
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 
Web Standards and Accessibility
Web Standards and AccessibilityWeb Standards and Accessibility
Web Standards and Accessibility
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Slides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks SitesSlides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks Sites
 

Semelhante a CSS for Mobile

HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)Adam Lu
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development LandscapeAmbert Ho
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalFour Kitchens
 
Phonegap facebook- plugin
Phonegap facebook- pluginPhonegap facebook- plugin
Phonegap facebook- pluginSteve Gill
 
Content strategy for mobile
Content strategy for mobileContent strategy for mobile
Content strategy for mobileKarolina Szczur
 
PhoneGap talk from Singapore
PhoneGap talk from SingaporePhoneGap talk from Singapore
PhoneGap talk from SingaporeSteve Gill
 
East of Toronto .NET Usergroup - Put the 5 in HTML
East of Toronto .NET Usergroup - Put the 5 in HTMLEast of Toronto .NET Usergroup - Put the 5 in HTML
East of Toronto .NET Usergroup - Put the 5 in HTMLFrédéric Harper
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesWesley Hales
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Todaydavyjones
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Brian Moon
 
Responsive Design Overview for UB CIT
Responsive Design Overview for UB CITResponsive Design Overview for UB CIT
Responsive Design Overview for UB CITAdrian Roselli
 
Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Clarissa Peterson
 
Advanced Android Design Implementation
Advanced Android Design ImplementationAdvanced Android Design Implementation
Advanced Android Design ImplementationTack Mobile
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App DevelopmentChris Morrell
 
Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile DevicesExtreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile DevicesMaximiliano Firtman
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?Denise Jacobs
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011davyjones
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrMichael Enslow
 
Mobile Web High Performance
Mobile Web High PerformanceMobile Web High Performance
Mobile Web High PerformanceAmjad Rafique
 

Semelhante a CSS for Mobile (20)

HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with Drupal
 
Phonegap facebook- plugin
Phonegap facebook- pluginPhonegap facebook- plugin
Phonegap facebook- plugin
 
Content strategy for mobile
Content strategy for mobileContent strategy for mobile
Content strategy for mobile
 
PhoneGap talk from Singapore
PhoneGap talk from SingaporePhoneGap talk from Singapore
PhoneGap talk from Singapore
 
East of Toronto .NET Usergroup - Put the 5 in HTML
East of Toronto .NET Usergroup - Put the 5 in HTMLEast of Toronto .NET Usergroup - Put the 5 in HTML
East of Toronto .NET Usergroup - Put the 5 in HTML
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3
 
Responsive Design Overview for UB CIT
Responsive Design Overview for UB CITResponsive Design Overview for UB CIT
Responsive Design Overview for UB CIT
 
Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Introduction to Responsive Design v.2
Introduction to Responsive Design v.2
 
Advanced Android Design Implementation
Advanced Android Design ImplementationAdvanced Android Design Implementation
Advanced Android Design Implementation
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile DevicesExtreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Devices
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Mobile Web High Performance
Mobile Web High PerformanceMobile Web High Performance
Mobile Web High Performance
 

Último

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 

Último (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 

CSS for Mobile

  • 1. CSS for Mobile Daniel Ryan BarCamp Chattanooga, July 25, 2009
  • 2. The Advent of iPhone • Approximately 15% of all internet traffic is now from mobile platforms • Of mobile browsers, Mobile Safari holds a 67% usage share
  • 3. Mobile Platform Usage Mobile Safari Java ME Windows Mobile Android Symbian Palm Blackberry BREW 2% 2% 2% Symbian 6% Android 6% Mobile Safari 66% Windows Mobile 7% Java ME 9% Source: http://mobilitytoday.com/news/009360/safari_iphone_king_browser
  • 6. Mobile Platform Usage Webkit Opera IE Palm Blackberry Other 1% 2% 2% IE 7% Opera 12% Webkit 76%
  • 9. Two Approaches • Separate Style Sheet • Additional rules in the same Style Sheet
  • 10. Separate Style Sheet <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ... <link rel="stylesheet" href="/css/barcampchatt.css" type="text/css" /> <link media="only screen and (max-device-width: 480px)" href="/css/ mobile.css" type="text/css" rel="stylesheet" /> ... </head>
  • 11. Additional Rules ... @media only screen and (max-device-width: 480px) { body { font-size: 17px; font-family: Helvetica, sans-serif; } a { color: #e2f7d8; } h1, h2, h3, h4, h5, h6 { font-weight: bold; font-size: 100% !important; color: #fff; font-family: inherit; } } Source: http://squaregirl.com/blog/2009/6/1/iphone-css.html
  • 12. Additional Rules ... @media only screen and (max-device-width: 480px) { body { font-size: 17px; font-family: Helvetica, sans-serif; } a { color: #e2f7d8; } h1, h2, h3, h4, h5, h6 { font-weight: bold; font-size: 100% !important; color: #fff; font-family: inherit; } }
  • 14. First Steps <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
  • 15. First Steps <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> body { font-size: 17px; font-family: Helvetica, sans-serif; } #bd, #sb { float: none; }
  • 16. Reusing Graphic Elements Source: http://www.css3.info/preview/background-size/
  • 17. Reusing Graphic Elements allows you to rescale an image -webkit-background-size without having to make a separate file. it accepts an x and y value, with “auto” being acceptable for either. Source: http://www.css3.info/preview/background-size/
  • 18. Reusing Graphic Elements allows you to rescale an image -webkit-background-size without having to make a separate file. it accepts an x and y value, with “auto” being acceptable for either. #hd p.logo a { -webkit-background-size: auto 40px; } Source: http://www.css3.info/preview/background-size/
  • 19. Reducing Graphic Elements Source: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
  • 20. Reducing Graphic Elements -webkit-gradient allows you to have the browser draw gradient backgrounds for you. It can be used anywhere an url(‘../path/to/file’) can be used. Source: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
  • 21. Reducing Graphic Elements -webkit-gradient allows you to have the browser draw gradient backgrounds for you. It can be used anywhere an url(‘../path/to/file’) can be used. #hd { background: -webkit-gradient(linear, center top, center bottom, from(rgba(0,0,0,0.5)), color-stop(0.1, #fff), to(#fff)); } Source: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
  • 23. Reducing Graphic Elements allows you to have transparent color values. It rgba(0,0,0,0) can be used anywhere a color code can be used.
  • 24. Reducing Graphic Elements allows you to have transparent color values. It rgba(0,0,0,0) can be used anywhere a color code can be used. #hd { background: rgba(0,0,0,0.5); }
  • 26. Best Practices • Reduce the number of assets
  • 27. Best Practices • Reduce the number of assets • Use CSS to replace assets where possible
  • 28. Best Practices • Reduce the number of assets • Use CSS to replace assets where possible • Hide objects that the platform cannot view
  • 29. Best Practices • Reduce the number of assets • Use CSS to replace assets where possible • Hide objects that the platform cannot view • Use native font faces and sizes
  • 30. Best Practices • Reduce the number of • Reduce multicolumn assets layouts to single column • Use CSS to replace assets where possible • Hide objects that the platform cannot view • Use native font faces and sizes
  • 31. Best Practices • Reduce the number of • Reduce multicolumn assets layouts to single column • Use CSS to replace • Visually reorder the page assets where possible flow where applicable • Hide objects that the platform cannot view • Use native font faces and sizes
  • 32. Best Practices • Reduce the number of • Reduce multicolumn assets layouts to single column • Use CSS to replace • Visually reorder the page assets where possible flow where applicable • Hide objects that the • Use native-esque platform cannot view controls • Use native font faces and sizes
  • 33. Best Practices • Reduce the number of • Reduce multicolumn assets layouts to single column • Use CSS to replace • Visually reorder the page assets where possible flow where applicable • Hide objects that the • Use native-esque platform cannot view controls • Use native font faces and • Change any overflow: auto sizes elements to overflow: visible
  • 34. Some Real World Examples
  • 35. Some Real World Examples
  • 36. Some Real World Examples
  • 37. Additional Resources http://developer.apple.com/safari/ http://webkit.org/ http://www.alistapart.com/articles/return-of-the-mobile-stylesheet/ http://www.alistapart.com/articles/putyourcontentinmypocket/ http://girliemac.com/blog/2008/07/19/webkit-css-animation-examples/ http://dryan.com/css-for-mobile http://www.slideshare.net/danielryan/css-for-mobile/