Web design and the Retina Display

Discussion in 'Web Design and Development' started by pelsar, Dec 31, 2012.

  1. pelsar macrumors regular

    Apr 29, 2008
    I've been reading and reading and still dont get the answers:
    the Retina display has 2x the pixels, which means as i understand it, if i'm designing a website thats good for the MBP and its retina display i have to make the site 2x as large as i normally do

    of course on the non retina screens, which is most of the world thats absurd.

    so am I designing 2 websites? one for the retina display and the second for the rest of the world?

    and since its a responsive website, of those two sites which one go to the iPad and iPhone?
  2. theluggage macrumors 68040

    Jul 29, 2011
    No, the rMBP/iPad 3/4 scale up the site so that 1 "pixel" width in HTML/CSS = 2 physical pixel widths on the screen. You don't have to do anything.

    If you want your bitmap graphics to take advantage of the retina display, then the quick'n'dirty solution is to prepare them at twice the size, then specify the "real" size in the HTML or CSS.

    E.g. if you currently have a 200x200 pixel image, prepare a 400x400 version then make sure the HTML says <img src="whatever" style="height: 200px; width: 200px;"> - or use CSS 'physical' units such as mm or points. Retina displays will display the full 400x400 pixels, regular displays will downsample it to 200x200. Only if you have lovingly hand-crafted pixel-by-pixel graphics that would be desecrated by downsampling do you need to do two sets of graphics.

    Only fly in the ointment is that if you use CSS background images rather than <img> tags then you are limited to newer browsers that support "background-size" - but then you just need to supply two sets of images and use different stylesheets for older browsers (which you may need to do anyway).
  3. pelsar thread starter macrumors regular

    Apr 29, 2008
    wow...thats easy enough to understand....so the "cost" is the downloading the heavier images, but thats it, and no background images....

    thank you....
  4. circa7 macrumors regular

    Jan 8, 2013
    I would create two sets of images depending on the scenario. But use CSS as much as possible to minimize having to deal with images at all. Of course, I dont know what type of images you're referring to, so this is definitely a generalization.
  5. lucidmedia macrumors 6502a

    Oct 13, 2008
    Wellington, New Zealand
    Its a very heavy cost... particularly when you consider how much of the web is viewed over mobile data connections. Use javascript to profile your user and serve up images optimized for their device. Don't make everyone download retina-ready images.
  6. olup macrumors 6502

    Oct 11, 2011
    Is there any way to check the bandwidth with javascript or would one have to do some browser sniffing in that case?

    I'm still very new to javascript, so I'm not sure, if this is correct and would actually work.

    var body=document.getElementById('body')[0],
    }else if (highBandwidth) {
    }else {
               body.innerHTML='Sorry there is no data connection in your area';

Share This Page