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

PPTX
Power point essentials
PPTX
Making Your Site Printable: Booster Conference
PDF
DrupalCamp NYC Panels Presentation - April 2014
PDF
Firefox for Mobile
PDF
Marek-Martin Matyska, Gamajun Games
PPTX
Question 6
PPT
Device channels v/s Responsive web design
PPTX
Mobile game development using Starling
Power point essentials
Making Your Site Printable: Booster Conference
DrupalCamp NYC Panels Presentation - April 2014
Firefox for Mobile
Marek-Martin Matyska, Gamajun Games
Question 6
Device channels v/s Responsive web design
Mobile game development using Starling

What's hot (20)

PPTX
Question 6
PDF
Jakub Dočkal, Alda Games
PPTX
Grade vi presentation and visual effects
PPTX
Planning- Editing and software
PPTX
Lean video production software
PPT
How to do a slideshow upload
PPTX
Changing the Wordpress theme
PDF
Responsive Web Design
PPTX
Power point essentials
PPT
PowerPoint - Quick Reminders
PPTX
The metro design language for app developers
PPTX
Exploring Microsoft Surface
PPTX
Equipment list
PPTX
Hb98908 midterm articulate powerpoint version
PDF
Infinity Blade and beyond
PPTX
SIUE IRIS Omeka Workshop
PDF
Customizability in Design Systems
PDF
Wdes105 day 2
PPTX
Adobe Lightroom Training Workshop Slides
PPTX
Lightroom Overview
Question 6
Jakub Dočkal, Alda Games
Grade vi presentation and visual effects
Planning- Editing and software
Lean video production software
How to do a slideshow upload
Changing the Wordpress theme
Responsive Web Design
Power point essentials
PowerPoint - Quick Reminders
The metro design language for app developers
Exploring Microsoft Surface
Equipment list
Hb98908 midterm articulate powerpoint version
Infinity Blade and beyond
SIUE IRIS Omeka Workshop
Customizability in Design Systems
Wdes105 day 2
Adobe Lightroom Training Workshop Slides
Lightroom Overview
Ad

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

PDF
Responsive design
PDF
Responsive websites. Toolbox
PPSX
Responsive Web Design: Tips and Tricks
PDF
Responsive web - CC FE & UX
PDF
Responsive Websites
KEY
Responsive Design & Mobile First
PDF
Responsive Web Design
PDF
Designing for mobile
PDF
Designing for The Modern Web
PDF
Mobile First Responsive Design
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
PDF
[SF HTML5] Responsive Cross-Device Development with Web Standards (2013)
PDF
Sbwire 531031
PDF
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
PDF
The Magic and Pain of Responsive Design
PPTX
Secrets of responsive web design by Sameera Thilakasiri
PDF
Html 5 mobile - nitty gritty
PDF
Responsive Web Site Design
PDF
Responsive web design
KEY
The future of BYU web design
Responsive design
Responsive websites. Toolbox
Responsive Web Design: Tips and Tricks
Responsive web - CC FE & UX
Responsive Websites
Responsive Design & Mobile First
Responsive Web Design
Designing for mobile
Designing for The Modern Web
Mobile First Responsive Design
Using Responsive Web Design To Make Your Web Work Everywhere
[SF HTML5] Responsive Cross-Device Development with Web Standards (2013)
Sbwire 531031
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
The Magic and Pain of Responsive Design
Secrets of responsive web design by Sameera Thilakasiri
Html 5 mobile - nitty gritty
Responsive Web Site Design
Responsive web design
The future of BYU web design
Ad

Recently uploaded (20)

PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
PDF
The AI Revolution in Customer Service - 2025
PPTX
Microsoft User Copilot Training Slide Deck
PPTX
Internet of Everything -Basic concepts details
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
SaaS reusability assessment using machine learning techniques
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
Module 1 Introduction to Web Programming .pptx
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
The AI Revolution in Customer Service - 2025
Microsoft User Copilot Training Slide Deck
Internet of Everything -Basic concepts details
LMS bot: enhanced learning management systems for improved student learning e...
4 layer Arch & Reference Arch of IoT.pdf
Ensemble model-based arrhythmia classification with local interpretable model...
Basics of Cloud Computing - Cloud Ecosystem
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
SaaS reusability assessment using machine learning techniques
NewMind AI Weekly Chronicles – August ’25 Week IV
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
A symptom-driven medical diagnosis support model based on machine learning te...
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Build Real-Time ML Apps with Python, Feast & NoSQL
Lung cancer patients survival prediction using outlier detection and optimize...

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