This recent slideshow on designing inclusive mobile websites inspired me to build a mobile version of my website. I’ve been working on it a few hours and established some provisional mobile design dos and don’ts.
Here’s what the design should do:
- render appropriately across screen widths. It shouldn’t make readers scroll horizontally on a narrow screen, and it shouldn’t make reading difficult on a desktop monitor by making column measures too wide
- use
@mediarules so it’s easy to implement (no separate site) - work across browsers, regardless of how limited they are (because mobile ≠ iPhone). It therefore uses a ‘mobile first’ approach: The base stylesheet is appropriate for a narrow screen and the
@mediarules target wider, desktop screens, and/or advanced rendering engines (basically Webkit, Presto and Gecko).
Testing
It’s important to note that you can’t just reduce your desktop browser’s width to see if the layout works. Less capable mobile phones often come with browsers that interpret HTML and CSS differently, or don’t understand the whole of the CSS2 spec (let alone CSS3). I’ve therefore been testing on my work phone, a Nokia N78, which has the Symbian OS installed on it. I use the default browser. I guess it’s reasonably powerful in the grand scheme of things, but it’s no iPhone. The resolution is 240X320 pixels (it can be rotated).

The Nokia N78 (from http://dailymobile.se/wp-content/uploads/2008/11/nokia-n78-pictures12.jpg)
Observations
Obviously my N78 doesn’t represent all mobile phones and I’ve only been working on the design for a few hours. But it is a relatively basic browser compared to, say, Safari on an iPhone (even if the newest Symbian browser is built on Webkit). Here’s what I’ve found:
- CSS coverage is patchy; my mobile doesn’t seem to consistently recognise
overflowormax-width, for example, which made it nigh on impossible to control image widths - use relative sizing: ems and % work fine and allow stylesheet modifications to be made quickly (e.g. you can up font sizes on wider monitors by simply altering the
body‘s font size as a % and using ems down the cascade) - use javascript to make IE obey @media queries. That means only IE users who have turned javascript off won’t benefit from your @media queries
- use
paddinginstead ofmarginon yourbodyorwrapper divin your base styles. I foundmarginbehaviour unpredictable, whereasmargin: 0 autois a staple of desktop browser design - keep the above padding small. On my phone it seemed to have a disproportionate effect on the page gutters
- reduce margins between elements: you don’t have the luxury of much whitespace on a small mobile screen
- use
list-style-position: insideon bullets as there’s not enough room in the gutters for hanging bullets - take care resizing search boxes as they can expand unpredictably and bork the layout
- avoid floats as scrolling horizontally on a mobile is highly annoying
- be careful if you’re using HTML5. I don’t think my Nokia understood the new, structural tags (despite the script I fed it), at least it didn’t limit the width of
navin the same way as it didp(which meant the layout leaked beyond the screen width in some circumstance)
Why bother? Who actually browses on a small phone screen?
There’s a good gmail app on my phone, so I don’t need to visit gmail.com to get my email, which is all I really use the phone for online. Unless you visit a site designed specifically for a mobile (e.g. Box and BBC News), it’s a pretty dispiriting experience.
Still, if we are designing websites for mobile consumption, they should not, on principle, be closed to people who can’t afford an iPhone. And when it comes to reading from my Nokia, it’s actually a pretty pleasant experience if the site is designed correctly; after all, you can’t grab your desktop PC, put your feet up and read a news article from the comfort of your sofa.
If you are viewing this post on a mobile screen I’d be really grateful to hear your thoughts on the design.
Thanks for the insights, Leon. I’d like to really get into media queries, and am yet to watch that slideshow.
Any chance of seeing your CSS file to see how you structure it?
Fill your boots: The style sheet.
Ignore the contents section — I haven’t updated it yet. Basically, the media queries are at the end. They target windows with a minimum width of 855 pixels. The rest of the styles work best at a narrower width.
So you design for the mobile first and then target desktop browsers. It makes sense but takes a while to get your head round.
I had a little look on my own (touch) phone – a Sony Ericsson Xperia Mini – which runs on the Android operating system.
Your site loaded quickly and I found my way around it with no problems. I could alter the size of the font and everything realigned itself quickly and automatically.
Looked good, too, minimalist and clean typeface.
The picture of your phone was too large to fit on the screen, but most of it was there and I could quickly slide the page over to the right to see the part of the phone that was missing.
All in all it looks as though you’ve done a good job, as usual. Congratulations.
For my own part I use the WordPress Mobile Edition Plugin, which seems to ensure that mobile visitors to my site see it in its best light.
Thanks for checking, John. I would imagine the Android browser is based on Chrome, which would have really good HTML and CSS support, but it’s good to get confirmation.
Yes, I haven’t figured out images. Normally
max-width: 100%;ensures the image is resized if it stretches beyond its container.That plugins’s a really good, quick solution. I assume it doesn’t modify your existing style sheet, but replaces it completely?
As far as I can make out the android web browser is based on the open-source WebKit layout engine, coupled with Chrome’s V8 JavaScript engine.
And, yes, you’re right about the plugin. It replaces the existing style sheet, but in quite a pleasing way.
I’ve watched the presentation and looked at your styles – I’m convinced. The next site I do will be styled for mobile first, then progressively enhanced for larger screens. I think I’ll have just the client site to do it with, too.
Thanks!