Cover by Brian Fling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

CSS

What really makes the iPhone stand apart is its excellent support of CSS and JavaScript. Having desktop-grade CSS support means that you can use the same techniques to create mobile experiences as you would a desktop experience. Not only can the iPhone display a usable version of your site even if it isn’t optimized for mobile devices, but you can also create mobile web apps quickly and easily.

Traditionally in mobile, you were lucky if a mobile browser supported some CSS2; in fact you were lucky that most devices supported CSS-MP, the subset of CSS2 meant for mobile devices.

The importance of being able to create a consistent user experience across multiple devices was obviously important, but all but a few browsers were merely paying lip service to CSS support for years. That is, that was the case until the iPhone, which motivated the entire mobile industry to invest in their browsers and their ability to bring CSS-based, web standard designs to mobile devices on par with what we are accustomed to on the desktop web.

CSS2

The iPhone has excellent CSS2 support for a mobile browser. In fact, the iPhone might render CSS a bit better than the desktop web browser you’re using these days. Though WebKit and Safari for the desktop support the full CSS2 specification, passing the CSS2 Acid2 test with a 100 percent score (Figure 12-9), Mobile Safari fails on a number of tests, as seen in the following image.

Figure 12-9. How the iPhone fares with the Web Standards Project’s Acid2 test for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required