More about media queries; mailing list

As we all know, media queries are by far the best way to distinguish between desktop and mobile browsers, or, more generically, between the dozens of different screen sizes our users can have. Media queries are the future of the web.

Nonetheless, the fact that they are the future doesn’t mean that there are no problems. One is particularly tricky: what do we do for browsers that don’t support them?

IE8 and lower, as well as Symbian WebKit, do not support media queries. That is, the largest desktop browser and the largest mobile browser will not react to the latest weapon in our arsenal. They will only interpret the default styles, and ignore anything else.

How are we going to solve this problem? Right now I see three possibilities, none of which I like.

Use JavaScript; more specifically window.innerWidth , which gives the actual width of the visual viewport in both IE and Symbian WebKit. Disadvantage: there may be an ugly moment when the default layout is swapped for the JavaScript-based optimal layout. CSS media queries are parsed and interpreted before the browser starts to lay out the page. Scripts aren’t. Make sure the default styles are suitable for IE. Or for Symbian WebKit. Problem is: they can’t be suitable for both. Shall we sacrifice Symbian WebKit for IE? Or vice versa? Completely ignore the problem. That will work with developer-type sites, or with personal projects, but not for clients and websites with actual, normal users.

I don’t know the solution to this nasty problem. In order to discuss it, and the dozens of other problems the mobile web is bound to give rise to, I’ve set up a mailing list. Subscribe by sending an empty mail to mobile-web-subscribe@yahoogroups.com and join the discussion.

Comments are closed.