SlideShare a Scribd company logo
1 of 13
BUILDING WEBSITES FOR RETINA DISPLAYS:

  MAKING FRIENDS
   WITH PIXELS
              Shoshi Roberts
                @shoshizilla
PIXEL PERFECTION,
            NOT JUST FOR APPS
• Many devices have a 2x pixel density or higher (the iPhone 4
 is among them)

• Images   that are not optimized for them will be blurry and sad

• There   is no automatic standard for including hi-res images



      BUT THERE ARE SOME SOLUTIONS...
HOW BLURRY?
Not Optimized   Optimized
HOW BLURRY?
Not Optimized   Optimized
SHOW ME THE CODE!
#1 - FLUID LAYOUT

• First, use
          responsive or fluid design to create a page that
 looks great on all devices

• Alternatively, make   a mobile specific version of your site
#2 - USE CSS3
• Really, as    much as you like

• Mobile browsers, especially webkit, are largely up to date
  and support the latest properties.

• CSS3   for gradients, shadows, etc. will eliminate the need
  for using images in many cases

• It   improves performance! (like anything, when used in moderation)
#3 - OPTIMIZE YOUR IMAGES


• Make   2 versions:

 • One   at normal size (e.g. 100px by 100px)

 • One   at double size (e.g. 200px by 200px)
#4A - WRITE MEDIA QUERIES
h1.icon {
  width: 100px;
  height: 100px;
  /* This is your 100px by 100px image */
  background: transparent url(icon.png) 0 0 no-repeat;
}
@media screen and (-webkit-min-device-pixel-ratio: 2) and
                   (-o-min-device-pixel-ratio: 2) and
                   (min--moz-device-pixel-ratio: 2) and
                   (min-device-pixel-ratio: 2) {
  h1.icon {
    /* This is your 200px by 200px image */
    background: transparent url(icon-2x.png) 0 0 no-repeat;
       -moz-background-size: 100px 100px;    /* Firefox 3.6) */
          -o-background-size: 100px 100px;   /* Opera 9.5 */
    -webkit-background-size: 100px 100px;    /* Safari 3.0 */
             background-size: 100px 100px;
  }
}
#4B - OR USE SVG
HTML
<object data="icon.svg" type="image/svg+xml" class="vector">
</object>




CSS - Fluid
.vector {
  /* Use whatever percentages you like, the content will scale */
  width: 90%;
  height: 90%;
}
#5 - TEST, TEST, TEST!


• Look   at it on as many devices as you can.

• Pay   the most attention to the platforms your users visit on.
WRAPPING IT UP


• The   arms race for pixel density is on, make images that scale

• Use   a CSS3 when you can

• Use   media queries and SVG to optimize your image display
THANKS
        AND HAPPY HACKING!




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

More Related Content

What's hot

Grade vi presentation and visual effects
Grade vi presentation and visual effectsGrade vi presentation and visual effects
Grade vi presentation and visual effectsAnkita Shirke
 
Planning- Editing and software
Planning- Editing and software Planning- Editing and software
Planning- Editing and software megansimpson28
 
Lean video production software
Lean video production softwareLean video production software
Lean video production softwareLoCoMoTion Project
 
How to do a slideshow upload
How to do a slideshow uploadHow to do a slideshow upload
How to do a slideshow uploadcreativeartsclass
 
Changing the Wordpress theme
Changing the Wordpress themeChanging the Wordpress theme
Changing the Wordpress themeEdotensei15
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignNir Elbaz
 
Power point essentials
Power point essentialsPower point essentials
Power point essentialsvalell
 
PowerPoint - Quick Reminders
PowerPoint - Quick RemindersPowerPoint - Quick Reminders
PowerPoint - Quick Reminderscm_scholz
 
The metro design language for app developers
The metro design language for app developersThe metro design language for app developers
The metro design language for app developersWillem Meints
 
Exploring Microsoft Surface
Exploring Microsoft SurfaceExploring Microsoft Surface
Exploring Microsoft SurfaceIndezine.com
 
Hb98908 midterm articulate powerpoint version
Hb98908 midterm articulate powerpoint versionHb98908 midterm articulate powerpoint version
Hb98908 midterm articulate powerpoint versionheatherb98908
 
Infinity Blade and beyond
Infinity Blade and beyondInfinity Blade and beyond
Infinity Blade and beyondozlael ozlael
 
SIUE IRIS Omeka Workshop
SIUE IRIS Omeka WorkshopSIUE IRIS Omeka Workshop
SIUE IRIS Omeka WorkshopKayla Hays
 
Customizability in Design Systems
Customizability in Design SystemsCustomizability in Design Systems
Customizability in Design SystemsSarah Federman
 
Adobe Lightroom Training Workshop Slides
Adobe Lightroom Training Workshop SlidesAdobe Lightroom Training Workshop Slides
Adobe Lightroom Training Workshop SlidesJohn Mauremootoo
 

What's hot (20)

Question 6
Question 6 Question 6
Question 6
 
Jakub Dočkal, Alda Games
Jakub Dočkal, Alda GamesJakub Dočkal, Alda Games
Jakub Dočkal, Alda Games
 
Grade vi presentation and visual effects
Grade vi presentation and visual effectsGrade vi presentation and visual effects
Grade vi presentation and visual effects
 
Planning- Editing and software
Planning- Editing and software Planning- Editing and software
Planning- Editing and software
 
Lean video production software
Lean video production softwareLean video production software
Lean video production software
 
How to do a slideshow upload
How to do a slideshow uploadHow to do a slideshow upload
How to do a slideshow upload
 
Changing the Wordpress theme
Changing the Wordpress themeChanging the Wordpress theme
Changing the Wordpress theme
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Power point essentials
Power point essentialsPower point essentials
Power point essentials
 
PowerPoint - Quick Reminders
PowerPoint - Quick RemindersPowerPoint - Quick Reminders
PowerPoint - Quick Reminders
 
The metro design language for app developers
The metro design language for app developersThe metro design language for app developers
The metro design language for app developers
 
Exploring Microsoft Surface
Exploring Microsoft SurfaceExploring Microsoft Surface
Exploring Microsoft Surface
 
Equipment list
Equipment listEquipment list
Equipment list
 
Hb98908 midterm articulate powerpoint version
Hb98908 midterm articulate powerpoint versionHb98908 midterm articulate powerpoint version
Hb98908 midterm articulate powerpoint version
 
Infinity Blade and beyond
Infinity Blade and beyondInfinity Blade and beyond
Infinity Blade and beyond
 
SIUE IRIS Omeka Workshop
SIUE IRIS Omeka WorkshopSIUE IRIS Omeka Workshop
SIUE IRIS Omeka Workshop
 
Customizability in Design Systems
Customizability in Design SystemsCustomizability in Design Systems
Customizability in Design Systems
 
Wdes105 day 2
Wdes105 day 2Wdes105 day 2
Wdes105 day 2
 
Adobe Lightroom Training Workshop Slides
Adobe Lightroom Training Workshop SlidesAdobe Lightroom Training Workshop Slides
Adobe Lightroom Training Workshop Slides
 
Lightroom Overview
Lightroom OverviewLightroom Overview
Lightroom Overview
 

Similar to Building Websites for Retina Displays: Making Friends with Pixels

Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. ToolboxWojtek Zając
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practicesmintersam
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 
A Holistic Approach to HTML5 Game Design & Development
A Holistic Approach to HTML5 Game Design & DevelopmentA Holistic Approach to HTML5 Game Design & Development
A Holistic Approach to HTML5 Game Design & DevelopmentKarl Bunyan
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)Chris Mills
 
Html5 - the new kid on the block
Html5 - the new kid on the blockHtml5 - the new kid on the block
Html5 - the new kid on the blockMarian Borca
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development LandscapeAmbert Ho
 
Designing for mobile
Designing for mobileDesigning for mobile
Designing for mobileDee Sadler
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphiacanarymason
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive WebsitesJoe Seifi
 
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
 
HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)Adam Lu
 
Mobile Websites tips and tricks @HeartAndSole
Mobile Websites tips and tricks @HeartAndSoleMobile Websites tips and tricks @HeartAndSole
Mobile Websites tips and tricks @HeartAndSolefakedarren
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.GaziAhsan
 

Similar to Building Websites for Retina Displays: Making Friends with Pixels (20)

Simple mobile Websites
Simple mobile WebsitesSimple mobile Websites
Simple mobile Websites
 
Responsive Web Site Design
Responsive Web Site DesignResponsive Web Site Design
Responsive Web Site Design
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. Toolbox
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
A Holistic Approach to HTML5 Game Design & Development
A Holistic Approach to HTML5 Game Design & DevelopmentA Holistic Approach to HTML5 Game Design & Development
A Holistic Approach to HTML5 Game Design & Development
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)
 
Html5 - the new kid on the block
Html5 - the new kid on the blockHtml5 - the new kid on the block
Html5 - the new kid on the block
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
CSS for Mobile
CSS for MobileCSS for Mobile
CSS for Mobile
 
Designing for mobile
Designing for mobileDesigning for mobile
Designing for mobile
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphia
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
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?
 
HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)HTML5 on Mobile(For Designer)
HTML5 on Mobile(For Designer)
 
Mobile Websites tips and tricks @HeartAndSole
Mobile Websites tips and tricks @HeartAndSoleMobile Websites tips and tricks @HeartAndSole
Mobile Websites tips and tricks @HeartAndSole
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.
 

Recently uploaded

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Building Websites for Retina Displays: Making Friends with Pixels

  • 1. BUILDING WEBSITES FOR RETINA DISPLAYS: MAKING FRIENDS WITH PIXELS Shoshi Roberts @shoshizilla
  • 2. PIXEL PERFECTION, NOT JUST FOR APPS • Many devices have a 2x pixel density or higher (the iPhone 4 is among them) • Images that are not optimized for them will be blurry and sad • There is no automatic standard for including hi-res images BUT THERE ARE SOME SOLUTIONS...
  • 5. SHOW ME THE CODE!
  • 6. #1 - FLUID LAYOUT • First, use responsive or fluid design to create a page that looks great on all devices • Alternatively, make a mobile specific version of your site
  • 7. #2 - USE CSS3 • Really, as much as you like • Mobile browsers, especially webkit, are largely up to date and support the latest properties. • CSS3 for gradients, shadows, etc. will eliminate the need for using images in many cases • It improves performance! (like anything, when used in moderation)
  • 8. #3 - OPTIMIZE YOUR IMAGES • Make 2 versions: • One at normal size (e.g. 100px by 100px) • One at double size (e.g. 200px by 200px)
  • 9. #4A - WRITE MEDIA QUERIES h1.icon { width: 100px; height: 100px; /* This is your 100px by 100px image */ background: transparent url(icon.png) 0 0 no-repeat; } @media screen and (-webkit-min-device-pixel-ratio: 2) and (-o-min-device-pixel-ratio: 2) and (min--moz-device-pixel-ratio: 2) and (min-device-pixel-ratio: 2) { h1.icon { /* This is your 200px by 200px image */ background: transparent url(icon-2x.png) 0 0 no-repeat; -moz-background-size: 100px 100px; /* Firefox 3.6) */ -o-background-size: 100px 100px; /* Opera 9.5 */ -webkit-background-size: 100px 100px; /* Safari 3.0 */ background-size: 100px 100px; } }
  • 10. #4B - OR USE SVG HTML <object data="icon.svg" type="image/svg+xml" class="vector"> </object> CSS - Fluid .vector { /* Use whatever percentages you like, the content will scale */ width: 90%; height: 90%; }
  • 11. #5 - TEST, TEST, TEST! • Look at it on as many devices as you can. • Pay the most attention to the platforms your users visit on.
  • 12. WRAPPING IT UP • The arms race for pixel density is on, make images that scale • Use a CSS3 when you can • Use media queries and SVG to optimize your image display
  • 13. THANKS AND HAPPY HACKING! @shoshizilla for @ladieswhocode Special Thanks to @mintdigital for hosting