Unintentionally Blank

Phil Nash on the Internet, Web Standards and Accessibility

Opera Mini 4 Released & The Death Of The Handheld Style Sheet

Nov 15, 2007

by Phil Nash

Firstly I'm excited. Opera Mini 4 was released last week. I didn't use the beta as I was happy with Opera Mini 3, but now version 4 is fully operational I have upgrade (though I only just found out... it seems that no-one cares about Opera Mini when there's an iPhone being released). Secondly, I'm a little confused, Opera Mini 4, like the iPhone's Safari, no longer supports handheld style sheets.

Quality Browsing On The Small Screen

Opera Mini 4 brings a whole load of new functionality to the mobile web, it's available for most modern phones and renders full web pages (mostly) as the designer had intended. It allows for zooming in to pages to read the content and lines text up in screen width sized columns. It gives you a virtual mouse that you can scroll around the screen with and click links. JavaScript and AJAX support has also been improved, which is good news for users of modern, JavaScript heavy sites. This is a great step for the mobile web, users will now be even better served when surfing from their mobile and site owners have less to do to make their site compatible with mobile platforms. If Safari on iPhone hadn't already done this, this would be big news, sadly, even though Opera Mini runs on most modern phones, excluding the iPhone of course, and can modernise the mobile web for many more users, it won't be.

The Death Of The Handheld Style Sheet

The handheld style sheet is one that can be served to mobile devices using media definitions in the link, like this:

<link rel="stylesheet" href="screen.css" media="screen" />
<link rel="stylesheet" href="mobile.css" media="handheld" />

The first declaration above loads a style sheet for screen use and the second for mobile, if the browser supports it.

Now you know what the handheld style sheet is, forget it. Today's premier mobile browsers, Opera Mini 4 and Safari on iPhone don't pay it any attention. The handheld style sheet is obsolete. Opera's reason for this was:

[..] the main issue with handheld is that you are not giving the user much of a choice of what content is delivered to their phone. These days, phones are much more powerful than they used to be, and it is a bit insulting to have a web site see you are a mobile device, and then serve you a really dumbed down version of it's content, even thought the device could quite easily support the full desktop version of the site. If you check out Opera Mobile 8.65, or WebKit on the iPhone, you'll see a browser of comparable power to their desktop cousins.

This almost seems fair. Opera Mini, Safari on iPhone, Opera Mobile can all create an experience akin to using a desktop, with a bit of zooming in and out and panning around the screen it is all the same. Why give developers the ability to take that away with a handheld style sheet?

My opinion was that handheld style sheets aren't for removing content or taking away from the experience of mobile browsing, I considered that they were useful for shrinking pages for the mobile platform, taking out unnecessary background images that would only take a long time to download over mobile networks or even organising the content in the right order. Providing a different experience for mobile users is more the realm of browser sniffing and redirection.

Handheld Reincarnation, Already!

Handheld style sheets are back already though, just under a different name. Opera Mini 4 and Safari on iPhone both support CSS3 media queries, allowing you to target styles to screen sizes. In my opinion this invalidates Opera's arguments for dropping handheld support, since the same effects could be performed through media queries. However, these media queries could be used to perform styling for the mobile devices that I mention above too, so all is not lost, unless you think life for developers could be as hellish as Christian Montoya's prediction

Conclusion

It looks like handheld style sheets are gone, and media queries and CSS3 are the future. In time, and as support grows for these media queries, we may find use for them in a more general context, shuffling dynamically between 1, 2 or 3 column layouts based on browser size comes to mind, with mobile browsers likely to get the 1 column version.

More importantly, mobile browsing has taken another step forward. If you like to surf on your mobile and you don't already have Opera Mini, go and get it.

Unintentionally Blank is Phil Nash's thoughts on web development from 2006-2008. Any code or opinions may be out of date.