Shrinking Background Tiles & iPads (and iPhones): Theme Designer Tip #3
Just one of those things intrepid designers come across unexpectedly and have to spend several hours trying to resolve. A new site design used a large background image for the homepage and variation of it for the inside pages. Everything was looking great on my mac and pc in IE, FF, Chrome, and Safari. Then I opened the site on my iPad 2 and had one of those moments. The site looked screwy, and it took a minute to figure out what was going wrong. It was the background images – they were being “shrunk”. An image that was 1800px wide by 1200px tall (only the central part of which would be visible through a smaller viewport like an iPad or laptop) was appearing on the page in it’s entirety, appearing to be about 500px wide and correspondingly short.
I had never run into this problem before – I’ve used large background tiles extensively and they all appeared just fine in the iPad. Even beginning to try to troubleshoot was a challenge as there’s not a lot of material out there on the web yet as compared to, say, Internet Explorer Bugs. I did all the usual things: checked my CSS and HTML at W3C—no help. Reviewed material on using background tiles—no help. There was nothing unusual about what I was doing that I could discern.
Next step was to post the problem on a couple of forums—two didn’t respond at all and the third responded but had no answer.
The third phase was to search in Google using one variation after another of the search phrase, trying to get some relevant results. And finally, after posing the tenth or eleventh variation of the question I hit paydirt.
These articles saved the day:
http://www.teknocat.org/blog/web-dev…-scaling-quirk
which linked to:
http://www.defusion.org.uk/archives/…iphone-safari/
The problem? The size of the background tiles. Basically the width times the height (1800 x 1200) could not exceed 2,000,000. If it did, Safari would shrink it (which is what it was doing). My home page tile was 2,160,000 and the inside tile even larger. Apparently it doesn’t matter what the combination of height & width are, as long as they don’t, when multiplied together, exceed 2,000,000. (The writers of the articles listed above discovered this quirk when working on iPhone designs and discovered it occurred on iPads as well.)
Back to Photoshop, various adjustments to deal with rough edges, tiles reduced and all was well.
You learn something new everyday!
Comments Off

No Comments