Making shropshire.gov.uk responsive

Mobile web traffic to our website has been rising dramatically

We’ve seen mobile traffic to shropshire.gov.uk rising steeply recently, so over the coming months we are kicking off a project to make our website work better with mobile and tablet devices. We are currently researching best practice and these are some of the things we have found:

Design for the screen, not the device

There is an ever growing number of devices that fall under the ‘Mobile Web’ user experience, with a whole host of smartphones already available using different operating systems (Andorid, iOS, Windows etc) at various screen resolutions. As I write this article the tablet market is also approaching full flight with many manufacturers lining up dates for the release of their first tablet products.

So how do we take an approach that can cover all these different devices? We can’t take an individualistic approach or the development and testing time would be endless. Instead we use the method of grouping devices by screen resolution, or more specifically device width. So in general terms, tablets have a similar screen resolution – we can call these ‘large’ devices, and mobiles can be grouped into ‘medium’ and ‘small’ categories depending on their screen resolution.

Many modern smartphones and tablets also have device orientation which is something to consider. You can switch the device from portrait to landscape and vice-versa, and all of a sudden the width we have to work with has increased/decreased. We need to be able to respond to these changes accordingly so that we can make use of as much of the available space as possible.

Same website, different styles

We don’t want to be building a different version of a website for each environment we want to support. A much more efficient and manageable way is to make the website respond to our environment. The easiest way to approach this is with HTML5 & CSS3 media queries. Media queries can detect the size of the window or the orientation of the device and enables you to serve alternative styles.

Firstly, let’s take the Shropshire Council Newsroom as an example site (the Newsroom will be our first site that is enhanced for viewing on mobile devices). It uses the good old, tried and trusted 960 pixel (px) fixed width layout with three columns. Two columns for main content, the 3rd for additional information and/or additional navigation.

Now let’s take any tablet as an example device medium. Research shows us that popular tablets that are either already available or are soon-to-be-available, use a width from 1024 to 1200 px and a height from 600 to 800 px (landscape orientation). So this information tells us that our 960px width site will already correctly scale to landscape oriented tablets.

If we rotate the tablet to portrait our viewing width is suddenly reduced and we now find that the width of the website has exceeded the maximum width of the (any) tablet. This usually has one of two knock-on effects:

So what can we do? Well we know that we only want to start changing the design if the screen width is less than the fixed with of the site. So we use a media query to identify this.

  @media only screen and (max-width: 959px) {

  }

Within this query we can then write our css rules as normal. So, for example, turn our 960px width three 320px column layout into a 640px width two 320px column layout:

  @media only screen and (max-width: 959px) {
    .section {
      width: 640px;
    }
  }

This rule will be valid for all devices that have a width of in-between 640px and 959px. Why 640px? Because as soon as we hit a device with a width of less than 640px we will start having the pre-mentioned problems of scaling or horizontal scrolling. We can introduce other queries that will cascade down to smaller devices to the point where we can display a 320px width single column layout:

  @media only screen and (max-width: 479px) {
    .section {
      width: 320px;
    }
  }

You can introduce as many media queries as you like. The development of the Newsroom has three queries that cascade down from the main css. Generally speaking, the first is to cover portrait oriented tablets, the second covers landscape oriented smartphones and the third covers portrait oriented smartphones. However, there will be some variation in these queries as, smartphones especially, have a whole range of resolutions.

Let context inform your design decisions

One thing a mobile design should not do is hide content to reduce the weight of the page or improve website performance. If we are hiding content, does that mean the content is page clutter? also, why are we only showing this clutter to desktop users? and, why are we showing clutter in the first place?

We can not assume that just because someone is visiting a website on a mobile device, they only interested in priority content or are ‘in a rush’. A mobile design should have all content available, but be displayed in a more suitable layout. We could promote services that are more likely to be useful for mobile users, but we shouldn’t remove or obscure anything in order to do this.

Easier for touch users means easier for all

Apple’s iOS Human Interface Guidelines tells us to ensure buttons are comfortable for a touch users and Fitt’s law tells us that the larger you make a button, the easier it becomes to click. Combining the two means that it will make your website easier to use for all users.

Give users the choice

So we have completed our designs and now mobile users are presented with a more appropriate design, but that isn’t quite the end of the story. Not everyone has the same likes and will prefer to use the ‘original’ desktop design on a mobile. So we need to be able to give users the option to ‘switch off’ the mobile styles.

The way we do this is provide a link at the top of the page which will remove our mobile stylesheet. We also provide a second link so that users can go back to the mobile design – that way they are not stuck in a specific design. At this point we also set a cookie so that the browser will remember which design the user has selected, so when they revisit the site at a later date, their preference is recalled without them having to set it again.

Final thoughts

The mobile web is not a brand new thing but was something that was not particularly common until recently. The latest breed of hardware (mobile devices) and software (browsers) has really helped it gain momentum as it has made it more usable and accessible.

The responsive technique described in this article is a modern approach, which is widely supported by the common competitors in the modern mobile browser market. Older approaches usually involved client side scripting or very specific (and not particularly cross-browser compatible) code, and were pretty ‘heavy’.

As this cross-browser friendly approach takes hold and more mobile designs start hitting the Mobile web, there are differing ideas and opinions about good practices being shared. The idea of hiding content to ‘streamline’ a website for a mobile is ill-advised, as mentioned in this article, but other designers may argue otherwise.

We may not have got everything right in our first approach so we will be revisiting our methods on a regular basis. That way as we learn more and technology develops we can enhance the mobile experience for our mobile customers.

3 comments

  1. This is something I’m working on too. The new book Responsive Web Design is very handy, showing how to use flexible grids and dynamically-scaled images along with media queries to produce web pages that work for all screen sizes.

    One issue to decide is whether to start from a “desktop” site and scale it down for mobile, or to start from mobile and scale it up. I’m inclined to think that mobile first is the better approach: Do something basic that works for everyone and then progressively enhance it. Starting small also forces you to focus on the things that really matter.

    Another intriguing possibility is designing more powerful interfaces for larger screens. If someone wants to run the site at over 1400px wide, what should we do for them? This is tricky because the large canvas can lead to an undiscriminating approach.

    I’m looking forward to seeing what you come up with.

    • Hi Adrian

      Yes I agree. The newsroom already exists as a desktop website so we are doing the scale down approach for that particular design. However we have a couple of new projects in the pipeline where we are taking the mobile design into consideration from the start and scaling it up. Even in the early stages of these new projects I am finding the scale up approach to be more favourable.

      Regarding larger screens, as you say the possibility is there and worth exploring – it could certainly work for websites that have the appropriate context.

      Thanks for your comments.

  2. Hi Lewis,

    Very in depth infomation here. At Toronto web design and web development firm we choose a solution base on own client needs. The HTML5 and CSS3 is for client site that doesn’t have many components on the page. It is easy to display all the infomation for the page by changing the layout base on the the mobile screen resolution. For clients that have many many components on the page as you would categoried them as “clutter” above. We have go with the slim down version of the site for mobile devices. Only show what are most important. Not because we can’t show them all, but because the differces of the wifi speed vs 3G which can be very slow on mobile. It is also because our stats showing that even though the number of users who using the lates generation of smart phone such as IPhone, Black Berry Torch, Samsung Galaxy…are rapidly increasing, there are still a large amount of using using the older generation of smart phone to surf the web. They are equipt with slow processor which will hiccup when load heavy pages. Of course we will have to included a link to the full site for the later smart phone users you like to see everythings rather than the conpacted version of the site. Trying to de-clutter the desktop version of the site by sutting off what we think are not neccessary most of the time won’t go well with our clients. If anything they would like to add more thing to the site and it is our job to present them better.
    I’m definitely agreed that HTML5 and CSS3 will keeping closing the gap between the desktop version and the mobile version for a web site for most cases, but there are some cases they just not as effective as the 2 individual versions of the site.

Leave a Reply