Chapter 8. Mobile and Beyond

There are two things you need to give a lot of thought to when you’re creating a responsive website: users and devices. In this chapter, we’ll discuss both extensively.

First, we’ll look at what the user experience is and why it’s important. Next, we’ll discuss design strategies for making sure your site works well and looks good on as many devices as possible.

Following that, we’ll go over the types of devices that are currently available, and some of the device qualities that are important design considerations, such as touch and screen size. We’ll also talk about how to make sure your site is accessible to users with disabilities.

Finally, we’ll talk about testing your responsive website—what devices you should support and test your site on, how you can get access to those devices, and what kinds of testing you can do without actual devices.

User Experience

When you’re making a website, your job isn’t just to make it look nice; it’s to make something that can be used for its intended purpose, and that works well.

Your ecommerce site can have the most beautiful product pages ever, but if the user has trouble getting through the checkout process and decides to go to another website, it’s all for naught.

User experience has always been a significant part of web design, but for a long time we didn’t have to put too much effort into it, because all users had a very similar experience—they were all on a desktop or laptop computer, with a similar-sized monitor, using a keyboard and mouse or perhaps a touchpad to navigate. We were designing on the same types of devices, so it was easy to predict how other users would experience the site.

But now everything is different. Not only do screen sizes range from teeny-tiny to ginormous, but we also interact with websites in a wide variety of ways, from touchpads to voice controls.

We’ve also stopped thinking of the Internet as something we experience. It used to be we would sit down at a desk, turn on our computers, and “go online.” But now the Internet is always with us. We can pull our phones out of our pockets anytime and anywhere, for quick interactions, long interactions, distracted interactions. We can pull the Internet up on our TVs or our game consoles, or even interact with web browsers on multiple devices simultaneously.

Remember that responsive design is not about designing for mobile. These days we tend to focus on mobile because we’re used to designing for non-mobile, and that’s natural. There’s a lot to learn and get used to. But there are plenty of people still sitting at desks behind monitors, so you can’t make sites that are optimized for mobile but feel awkward when you have a keyboard and monitor in front of you.

Before you make a responsive site, you need to know about the devices it will be viewed on, and how users interact with those devices. Your goal is to have a site that will work on the wide range of currently available devices and that is also future-friendly, able to accommodate devices that haven’t been invented yet.

Users Come First

Before we even get to talking about mobile devices, we need to talk some more about users. After all, users are the most important part of the equation when you’re making a website.

With the novelty of all the new types of mobile devices on the market and the new things that are possible in HTML5 and CSS3, it’s easy to get caught up in the excitement and spend time and effort developing exciting websites that show off all the things you can do.

But keep in mind that the purpose of a website isn’t to be as technologically impressive as possible. Learning to design and develop a website is not just about writing the code that renders the website. It’s about creating an experience for the people who will be using the website.

As much as all of us who work on the Web are talking about responsive design, making responsive sites, and thinking about responsive design, we need to remember that the average website user has no idea what responsive design is. And there’s no reason for him to.

All users want is a website that works well on the device they are using at that moment—which may not be the same device they are using at other times during the day. They don’t want to think about what device they’re using; they just want to have a website that works.

Users aren’t thinking about the fact that they’re using a mobile phone to visit a website on the way to work, a desktop computer during their lunch break, and a tablet when they’re browsing the Web while watching TV late at night. And it shouldn’t matter to them. They should just get a website that works, no matter which device they use to access it.

So when you’re designing a responsive site, keep in mind that your goal isn’t to create a responsive site, but rather to create a site that works well for users; responsive design is the tool you will use to create that site.

Users don’t care what’s under the hood. They just want a website that is going to give them the content and functionality that they want, with a minimum amount of fuss to get to where they want to go.

And always remember, it’s up to the user what device she wants to use, not up to you. You can decide what types of devices you want to support, but if your site doesn’t work on the device the user wants to use, you’ll lose that customer.

The Myth of the Mobile User

When the iPhone first came out and we started designing websites to work on mobile phones, there was this “myth of the mobile user” that came about: the idea that any person using a mobile device was “out and about,” on the go, in a hurry to get somewhere, in a hurry to get information. That typical mobile phone user didn’t want to browse the Web, he just wanted to get quick information, like a restaurant address or whether his flight was on time.

And at that point, the myth was probably true. It was hard to access websites on a smartphone. There weren’t yet responsive sites or even many mobile sites, so what you had was a tiny site you had to zoom in and out on to read anything. Users probably didn’t use their mobile phones to access websites unless they absolutely had to, and saved their web browsing for their home or office computers, where it was much easier.

But then websites started to change to accommodate mobile phones, and it got easier to do things on your phone. And then tablets came along, which were mobile, but not really, because a lot of them only worked on WiFi so you weren’t really mobile when you were using them.

And now people use their mobile phones all the time, whether they’re out of the house or sitting on the sofa at home with a laptop a couple of feet away, because it’s just easier to reach for the phone.

More and more people are relying on mobile devices as their primary or only way of accessing the Internet, so you can’t keep assuming that users only want to look up restaurant addresses or flight times. People want to do everything on their mobile devices that they could do on their desktop computers—that is, as long as you let them.

Designing for Context

Although we shouldn’t assume that users of particular devices only want certain content or interactions, we can determine that particular parts of the site are used more often on certain devices, and make sure that content is very easy to access.

For example, we can’t assume that mobile device users only need certain content, because they aren’t necessarily “on the run” and looking for “on the run content.” However, they are sometimes “on the run.” And because it’s more difficult to navigate a website on a mobile phone using your fingers than it is to navigate a desktop site with a keyboard and mouse, we should make sure it’s easy for mobile users to get to the important things.

In Figure 8-1, a responsive website from Kiwi Bank in Australia, the narrow-width design has a few key links and pieces of information at the top. The login link is first—which is also prominent on the wider site, at the top right.

Following that, you see “Find a Branch,” the bank’s main phone number, and the bank’s opening hours. These are all things that some mobile users will want to get to easily and quickly when they’re in a hurry, so they are right there.

Using media queries, you can change what content is most prominent on the screen depending on viewport width.
Figure 8-1. Using media queries, you can change what content is most prominent on the screen depending on viewport width.

But you don’t see “Find a Branch,” the phone number, or the hours when you look at the wider version of the site. They’re still there—you just have to click on “Contact Us” to get to them. A desktop user is likely not in so much of a hurry, so she won’t mind a couple of extra clicks, which are easier to make when you have a mouse.

The mobile user still gets everything that you see on the wider design—he just needs to scroll down on the narrow-width site to get to the navigation and all the content. A mobile user looking for interest rate comparisons is probably not in as much of a hurry as a mobile device user who needs the branch hours, so he won’t mind the extra scrolling.

Mobile-Only Users

If you’re reading this book, it’s likely you have a job where you spend a good part of your day in front of a desktop or laptop computer. You can browse on the Internet whenever you want. It’s easy to forget not everybody has that desk job experience. People who work in service jobs, for example, generally don’t spend their work time in front of a computer. Some of them have computers at home, but some don’t. And some that do have computers just prefer to use mobile devices.

The rise of smartphones means that more and more people are going online from mobile devices. According to Pew Internet, 57% of Americans said they’d used a mobile device to access the Internet in 2013. A surprisingly large number—34%—of these mobile Internet users said that was the primary way they accessed the Web.[3] This is a large and growing audience.

Teens are increasingly mobile-primary users. Although many of them have access to a desktop computer at home, they have a greater sense of privacy on a mobile phone, which just belongs to them, as opposed to a desktop computer shared with other family members, where they may get little privacy. They also aren’t sitting in front of a computer all day like many office workers. Teens may not be a big part of your target audience, but as they grow into adults, they will continue to be comfortable using their phones for a majority of their web browsing.

So what does this mean? Your website has to work on all devices. You can’t assume that if something is too “complicated” for a small screen, you can just ignore the issue because users will switch to a larger screen for that activity. Not all of them will.

And don’t think that just telling users they need to switch to a desktop browser is enough. It’s not up to you what devices users choose; it’s up to them.

It may not be possible to make everything easy to use on a small screen, but at least don’t make things not usable. Unless, that is, you are willing to lose a portion of your users or customers.

Multi-Device Usage

One thing to consider as you’re making a responsive design that works across screen sizes is that any given user may visit your site from different devices at different times.

Although you’ll use responsive design to change how the website is displayed at different screen widths, you want to make sure that the experience feels the same even on different screen sizes. Users should be able to go to the site on different devices and not be unsure if it’s the same website. The color scheme, imagery, and fonts should be similar, no matter what device they are using.

Something like the navigation may be displayed very differently depending on screen size, but the same options should be available, using the same information architecture to organize them in the navigation.

Device-Agnostic Design

Before you start designing responsive websites, you should know where your website will be viewed. The answer is: anywhere.

There are an incredible number of devices available these days, and even if we start talking about all of them, we don’t know what devices are going to be invented next.

What do they have in common?

Most of them have a screen, but not all of them. Some users who are blind or visually impaired access the Web using a screen reader. Cars have Internet capabilities and can read you your email or the headlines; how long before you can surf the Web by listening to it in your car?

People use a wide range of input devices to access the Web. On a desktop, you’ll probably use a keyboard and mouse. On a laptop, the mouse is replaced with a trackpad. On a mobile phone or tablet, you’re using a touchscreen. On older mobile phones, you might be using little arrow keys.

The point here is that you can’t design for specific types of devices, because there are so many different types of devices out there, going far beyond what we think of as a standard mobile device. And there’s no way to predict what will be invented—which might be something that most of us couldn’t have even imagined.

Device-agnostic design means creating a design that is meant to work no matter what type of device is being used. You’re not designing for mobile, and you’re not designing for desktop; you’re designing for the Web—wherever it happens to be viewed.

Focusing on Mobile First

We talked a bit in the previous chapter about mobile first, which is the idea of creating a design that prioritizes users who are using mobile devices, and how those users interact with the site.

When you’re creating a device-agnostic design, this is the best way to start—not because the user experience on mobile devices is more important than the user experience on desktops or anything else, but because mobile devices have more constraints, and it’s more difficult to create a good user experience when you have limited screen space and a less familiar method of user interaction (touch).

We already talked about designing for small screens first, in Chapter 5. But the idea of mobile first goes beyond that, to focus on how users interact with the site and the device. Touch is the biggest complication. A layout that can be easily navigated with a mouse may be much harder to use when you’re poking at a small piece of glass with your large finger.

Later in this chapter we’ll talk about some of the issues specific to mobile, such as touchscreens and device capabilities. And in Chapter 11, we’ll talk about performance, another issue that generally applies to mobile, but where improvements will have an effect on all devices.

Do What You Can

Responsive design is not an all-or-nothing approach. Although ideally you would create a brand-new, fully responsive site from scratch for every project, in reality you’ll often be working with existing sites, and modifying or redesigning them to be responsive.

If you’re working with legacy code, or if you have limited resources, it’s not always possible to make a site fully responsive. But partially responsive is better than not responsive at all.

For example, Amazon’s website is not fully responsive, as only some elements are flexible, and only across wider screen widths (there’s a separate mobile site for phone-size screens).

Page elements have a fixed width, as you see in Figure 8-2, where the right edge of the page is cut off in a narrower browser window.

The right edge of the page is cut off in a narrower browser window.
Figure 8-2. The right edge of the page is cut off in a narrower browser window.

But as the viewport width increases, as in Figure 8-3, the whitespace between elements expands, so that the page continues to fill the entire width of the screen.

On a wider screen, the whitespace between the elements expands.
Figure 8-3. On a wider screen, the whitespace between the elements expands.

At a wide enough viewport width, where there’s enough room, the “Shop by Department” subnavigation menu changes from a drop-down link to a fully visible navigation, as in Figure 8-4. And as the viewport gets even wider, again the whitespace increases to fill the page, as in Figure 8-5.

In a wide enough viewport, the “Shop by Department” menu changes from a drop-down link to a fully visible navigation.
Figure 8-4. In a wide enough viewport, the “Shop by Department” menu changes from a drop-down link to a fully visible navigation.
The whitespace continues to increase to fill the page.
Figure 8-5. The whitespace continues to increase to fill the page.

On tablets, the desktop site is simply shrunk down to fit the viewport width exactly, as in Figure 8-6 (as any fixed-width site would be by default), although that means the text is fairly small and hard to read in the portrait view.

On tablets, the desktop site is shrunk down to fit the viewport width.
Figure 8-6. On tablets, the desktop site is shrunk down to fit the viewport width.

It’s not a responsive site, but it accommodates different screen sizes to some extent. This is an example of a little responsiveness being better than no responsiveness.

Types of Devices

There are tons of different types of devices that can access the Web—everything from the familiar interface of an iPhone to tablets of all sizes, laptops, desktops, game consoles, even refrigerators.

We’ll briefly go over the types of devices and differences among them, and then through the rest of the chapter talk about what you need to consider as you design responsive sites that can work on any device and any size screen.

Mobile Phones

As early as the mid-1990s, phones were available that could access the Web—although it was only text-based web browsing, a far cry from what we enjoy today. Web access on phones became more common through the early 2000s, although it was still only a limited version of the Web.

A smartphone, such as the iPhone, is really a miniature computer, with a mobile operating system that allows the user to install apps.

Feature phones, on the other hand, are not very much like your computer. These are the phones that people used a lot before the iPhone came out. They can access the Web, but when you view websites, they look nothing like they do on a monitor screen. Feature phones have fewer capabilities than smartphones and often don’t have a touchscreen, and you may have to navigate using a little button like in Figure 8-7.

But feature phones have not been replaced by smartphones. In the United States, 58% of adults own smartphones, while 32% own feature phones.[4] Some countries have much higher rates of smartphone penetration, such as the United Arab Emirates and South Korea, which are at about 73%, while other countries, such as those in sub-Saharan Africa, have many more feature phones than smartphones.[5]

Example of a feature phone (photo credit: Rodrigo Senna, ).
Figure 8-7. Example of a feature phone (photo credit: Rodrigo Senna, http://www.flickr.com/photos/negativz/38422354/).

Part of responsive design is making sure that your site will work on any device, not just adapt to the screen size. As we talked about in Chapter 3, by starting with good HTML and using progressive enhancement to add CSS and JavaScript for devices that support them, you can make sure your site is usable on the most basic feature phones.

If your site has a lot of complex interactivity, it may not be possible to have your whole website work well on every device, down to the oldest browsers and devices, but do what you can.

For example, perhaps you can’t make a restaurant website’s online ordering work on the oldest phones, but you should be able to make the page with the restaurant’s address and phone number work on pretty much every device, without a lot of extra effort.

Tablets

Tablets have become increasingly common in recent years. They’ve been around for many years, but didn’t become popular until the release of the iPad in 2010. The iPad is by far the most popular tablet, with other brands like Amazon’s Kindle Fire trailing far behind.

Tablets are mostly very similar to modern smartphones, generally using the same operating systems, like iOS and Android, and allowing for the installation of apps.

Many tablets only have web access via WiFi, not by cellular networks, so they aren’t technically classified as mobile devices. But that really doesn’t matter. The lines are so blurred that it’s no longer helpful to stick everything into categories of either mobile or nonmobile. It’s more of a vague continuum, with phones on one end (mostly mobile) and desktop computers on the other (mostly not mobile).

Ereaders are devices that are meant to be used primarily for reading downloaded books, but many of them now include web browsers and are marketed more as a tablet (like the Kindle Fire). Some ereaders, such as more basic versions of the Kindle, have built-in browsers with limited functionality but use e-ink instead of a traditional screen, so everything appears in grayscale.

Other Devices

Many game consoles now have built-in web browsers, allowing you to access the Web on the screen connected to your console.

Some of them have very primitive browsers, meaning that what you see on the screen may not be exactly what the designer intended. But as with feature phones, as long as the site starts with good HTML and then adds CSS and JavaScript as progressive enhancement, it should be usable on these devices as well.

You never know where a web browser is going to show up. For example, WiFi-enabled refrigerators have been available for several years (it’s kind of like having a small tablet embedded on the front of your fridge). Currently, they have a limited operating system that only supports certain apps, but I imagine it won’t be too long before you have a full web browser in front of you in the kitchen.

There are also now watches with browsers, browsers in cars, and Google Glass, which puts a browser directly in front of your eyes. These all have very different interfaces, and you can’t plan for all the possible devices that might exist in the next few years. But luckily, that’s where responsive design comes in. Your goal is to design a site that’s future-friendly, that will work on any screen size and any device, no matter the capabilities.

Desktop and Laptop Computers

Until a few years ago, our access to the Web was limited to desktop and laptop computers. This is the setup all of us are probably most familiar with:

  • A large screen

  • Input using a keyboard and a mouse, touchpad, or trackball

  • Desktops used at a desk, usually sitting, with little ability to change position

  • Laptops used at a desk, or on your lap while sitting, or sometimes when lying down

  • Nearly always using a wired connection or WiFi

We often think of these devices as having fast connections, but that’s not always true. Many home Internet connections are not all that fast, and laptops are often used in hotels, coffee shops, or other locations with slow WiFi. Some people in rural areas don’t have access to broadband, and use satellite Internet to connect.

Touch

Other than screen size, one of the key differences between smartphones and traditional computers is the input method.

Desktop and laptop computers have traditionally used keyboards in conjunction with pointing devices such as a mouse or trackpad, and we’re used to designing sites that can be easily used with those devices. Touch is a little more difficult to design for, and requires some additional attention to make sure the user experience is good.

There are things you can do to make your site work better on touchscreens—and these changes won’t detract from the experience on non-touch screens.

But don’t think that touch is something you only need to think about for phones and tablets. Now, many desktop computers are coming out with monitors that have touchscreens (even my mom bought one from QVC, the cable shopping channel). So it’s best to assume that every size screen could be touch-enabled.

And if you design for touch, everything will definitely work well with a mouse, while the opposite is not the case.

Note

Designing a good user experience for touch can be difficult. If you’d like to delve deeper into this area, check out Josh Clark’s Tapworthy: Designing Great iPhone Apps (http://shop.oreilly.com/product/0636920001133.do). Even though the book focuses on app design, most of the concepts are relevant to website design.

Capacitive Touch

Since the advent of the iPhone, the primary input method on smartphones has been a capacitive touchscreen.

Capacitive means that the screen works by measuring electrical charges conducted through anything touching the screen, such as a fingertip. The human body conducts electricity, but not all objects do, which is why touching a smartphone screen with something like a pen or a gloved finger has no effect. However, you can buy special styluses made of conductive material, or even gloves with conductive threads on the fingertips.

Older devices were sometimes made with resistive touchscreens, which have two thin layers that come together when the user presses on the outer surface with a fingertip or stylus. The screen is able to determine the precise location of the pressure. One disadvantage of this type of screen is that some amount of pressure is required, and the screens will often not register when a touch is too light. The screens are also more prone to damage.

Multi-Touch

Although phones with touch interfaces had been around for years by the time the iPhone was introduced in 2007, the iPhone was one of the first with a multi-touch interface, which allows the screen to recognize more than one point of contact simultaneously. This allowed for much more complex interaction with the screen, such as the pinch-to-zoom motion.

Gestures

Modern smartphones use gestures as a way to interact with the screen’s content, giving users a “hidden” way to use the interface, so less of the valuable screen real estate has to be taken up with controls.

The pinch-to-zoom gesture is one of the most common, allowing an intuitive way to zoom in and out on things like maps. If you were viewing the same map on a laptop/desktop, you would see a slider with plus and minus buttons taking up part of the screen.

Some gestures, such as zooming in and out on a web page, are built into the browser or OS. Others, such as swiping sideways to go to the next image in a slideshow, have to be added to a web page using JavaScript.

Although you could skip that step and require users to tap or click arrows to navigate a slideshow, adding in gesture support can make a site much easier to use on touchscreens. Adding functionality for devices that support it, where it would enhance the experience, is a key part of responsive web design.

You can find several JavaScript plug-ins to add swipe behavior, such as TouchSwipe (http://labs.rampinteractive.co.uk/touchSwipe/demos/) or Swipe (https://github.com/thebird/Swipe).

JavaScript Events

Touch events is a phrase used in the context of JavaScript to describe any interaction the user makes with the screen, whether it’s a simple tap or a multi-finger movement. There are three basic touch events, touchstart, touchmove, and touchend, which can be used to define pretty much any interaction.

In addition, a touchscreen device will recognize JavaScript events that were designed for a mouse, such as click.

Hover

The hover event is a bit tricky on touchscreens—obviously, you can’t just hover your fingertip over an element.

hover is used quite a bit on websites to change the visibility of elements via CSS (hide or display), such as a drop-down menu that appears when you hover over a link in a menu bar.

Most touchscreens automatically accommodate this by changing the element’s behavior to double tap. That means the first tap on the element acts as a hover and changes the visibility of the element, and the second tap selects the link. However, this is awkward, and you should avoid using hover.

Of course, you could use a media query to have a different type of navigation appear on smaller screens (see Chapter 10), but now many desktop computers have touchscreens, so you need to assume that any size screen could be a touchscreen.

Touch delay

You may have noticed that mobile apps sometimes seem to be much faster than websites you view on a mobile phone. One issue that contributes to this is actually built into how JavaScript works on touch devices.

JavaScript does its best to replicate mouse events, from onClick (clicking with the mouse) to touch events. So if the browser is expecting an onClick on an element, it knows that a tap is a click—but with a twist. The browser will wait and see if you tap again, making it a double tap instead of a single tap (the double tap is a way to zoom in on a web page). That is, after you tap, the browser waits 300 ms (.3 seconds) to make sure you’re not going to tap again before it goes ahead with the click event.

A third of a second doesn’t seem like much, but to the user the difference can be very noticeable, because it means that things don’t seem to happen “right away” when they tap.

Luckily, at least one browser maker has realized this is an issue and is starting to fix it. A beta version of Chrome for Android removes the 300 ms delay, but only for sites where the viewport element has the attribute content="width=device-width"—that is, responsive websites. The user can no longer double-click to zoom in, but zooming isn’t needed so much on responsive sites, and the user can still pinch-to-zoom.

It’s not clear if other browser manufacturers will follow in this direction, but in the meantime, there are JavaScript plug-ins you can use to remove the 300 ms delay on your site. Check out FastClick (https://github.com/ftlabs/fastclick) from FT Labs or Touche.js (http://benhowdle.im/touche/) from Ben Howdle.

Touch Target Size

For people using touchscreens to access your site, one of the biggest usability issues is touch target size (i.e., the size of the link or other element they need to select by tapping).

When using a mouse to click a link this isn’t nearly as important, because (for most users) it’s easy to get the cursor to exactly the right spot to click on a link or other element. But for users touching a screen, keep in mind that a finger is a lot bigger than a cursor, and if everything on the screen is really small, it’s hard to hit the right spot.

If a target is all by itself, that’s not a big deal, but if targets are very close together it’s easy to accidentally hit the wrong one, sending you to a page you don’t want to visit, or taking an action that you don’t want to take.

You’ll notice that when using a touchscreen, users actually tend to use the pads of their fingers (where the fingerprint is), not the fingertip (the very end of the finger). That can actually be a pretty wide area, depending on the person.

If a user is trying to hit a very small target he may sometimes use the fingertip instead of the finger pad to be more accurate, but this will slow the user down and make him work harder, which you don’t want to do.

The average index finger is 1.6–2 cm (.6–.8 inches) in width, according to a study by the MIT Touch Lab. That converts to about 45–57 pixels. Luckily, smartphones are pretty smart when it comes to taps, and even though your finger might be touching many pixels on the screen, it can usually figure out what you were trying to tap. But if the target is too small, your success level will go way down.

Phone manufacturers actually have guidelines in place for how large an element should be so that users can easily select it on touchscreens. Apple’s iPhone Human Interface Guidelines recommend that your touch target be at least 44 × 44 pixels. Microsoft Windows Phone recommends 34 pixels wide, with a minimum of 26 pixels. Nokia suggests your target should be at least 28 × 28 pixels.

That’s a lot of variation, so what numbers do you use? If targets are right next to each other, I recommend making them at least 44 pixels wide if at all possible.

As you’re testing your site on various mobile devices, make sure to check if links are easy to select on the touchscreens. And keep in mind that other people may not have fingers as limber as yours—some people have larger fingers, and older users may have more difficulty tapping precise points on the screen.

Increasing touch target size

You can use CSS to increase the size of touch targets. One way is to make sure any space around a link is padding rather than a margin. You’ll need to go back to the box model you learned about in Chapter 3, which explains the difference between padding and margins.

Consider this list of links in Figure 8-8. The links are close together and likely are difficult to hit with your finger, depending on the text size. I’ve outlined each link so you can see which part is the clickable/tappable area.

A list without styling has the links very close together.
Figure 8-8. A list without styling has the links very close together.

How can we improve this? To start, you can make each link display: block, which will make the <a> element a box that extends to the full width of the containing element, as in Figure 8-9, rather than stopping at the end of the last word:

ul a { display: block; }
Making each link block instead of inline makes the touch target boxes extend to the full width of the containing element.
Figure 8-9. Making each link block instead of inline makes the touch target boxes extend to the full width of the containing element.

To increase the touchable area, you can also increase the padding (not margin) of each <a>, which increases the touch target size in whichever directions you choose, as you see in Figure 8-10:

ul a { display: block; padding: 3px 5px; }
Adding padding increases the touch target size in any or all directions.
Figure 8-10. Adding padding increases the touch target size in any or all directions.

Don’t apply the padding to the <li>, or that will leave empty, non-tappable space between the links, as in Figure 8-11:

li { padding: 3px 5px; }
If you use padding on the list items, that leaves empty space between the links and makes the touch targets smaller.
Figure 8-11. If you use padding on the list items, that leaves empty space between the links and makes the touch targets smaller.

You should make use of all the available space; there’s no need for empty spaces to separate the links. Mouse users will click directly on the links, so there won’t be any confusion.

For links inside blocks of text like paragraphs, it’s a little trickier. By making sure there is enough space between the lines, you can keep links a bit further apart (we’ll look at how to do this with line-height in Chapter 9). Try not to have adjacent words be different links. Not only does that make them harder to click, but on touchscreens the users may not be able to tell there are multiple links, because they are not able to hover and see their targets.

Additionally, keep in mind this is going to be tricky for the smallest screens, where there’s not a lot of available space. If you need to make your touch targets smaller than you’d like for small screens, you can use media queries to change the target size for different screen sizes. In the preceding example, if your padding of 3 pixels and 5 pixels just won’t fit on a small screen, you can use media queries to give slightly less padding for the narrow screens and more ample padding for tablet size or wider.

While the navigation on websites and desktop applications has naturally evolved to appear at the top of the screen, with key elements like the home button or search box in the top corners, this layout is really only optimal if you’re using a mouse to get to the targets. With touchscreens, we enter a whole new usability world.

You know from using apps on a smartphone that navigation on apps often appears at the bottom of the screen, making it easier to hit those buttons with your thumb if you’re holding the phone in one hand.

It’s not just phones—with pretty much any touchscreen, it’s easiest to touch the part of the screen that’s closest to your hand. Even on a desktop touchscreen, it’s physically easier and less fatiguing for users to touch elements near the bottom of the screen.

And not only does placing controls at the bottom of the screen make them easier to reach, but it also has a bonus effect: your fingers (or your arms, with a desktop touch monitor) aren’t blocking the rest of the screen, so you can still see it.

This is a difficult topic, so we’ll touch on it only a bit in this book. In Chapter 10, we’ll look at an example of a website with navigation at the bottom of the screen. Although this adjustment to the standard user interface isn’t often used, it’s bound to become more common as web usage moves further away from traditional keyboard and mouse devices.

If you’d like to learn more about the idea of optimizing navigation for touchscreens, check out Josh Clark’s blog post, “New Rule: Every Desktop Design Has To Go Finger-Friendly” (http://globalmoxie.com/blog/desktop-touch-design.shtml) or Luke Wroblewski’s “Responsive Navigation: Optimizing for Touch Across Devices” (http://www.lukew.com/ff/entry.asp?1649).

Screen Size

When doing responsive design, a primary consideration is making sure that websites can be viewed on any size screen.

It used to be that you could categorize devices by screen size, and design for a few set sizes: mobile phone, tablet, laptop, wide screen. But now, devices no longer fit easily into such categories, because they come in pretty much any width imaginable.

Smartphones start out with a screen size of around 3 inches (diagonal), with many in the range of 4 or 5 inches. Currently, one of the largest phones is the Galaxy Mega, with a 6.3 inch screen. Yes, it looks gigantically huge when you hold it up to your ear, but many people use their phones primarily for Internet access, not for actually talking to people (and anyway, you can always use your headset to make calls).

The iPad mini, on the small end of the tablet range, has a screen size of 7.9 inches, not that much bigger than the largest phone. Many tablets fall within the range of 7 to 10 inches, with the iPad at 9.7 inches.

Touch-enabled Ultrabooks range from 11.6 to 13.3 inches, and touchscreen desktop monitors take off from there—I found one as large as 55 inches for sale online, although I’m sure the $5,000+ price tag doesn’t make it all that popular.

So, when you’re creating a responsive website, you need to create a design that works on every possible screen size. A few years ago, creating layouts for those four set device sizes worked decently, because nearly every phone was an iPhone and nearly every tablet was an iPad. But now that screens come in all sizes, focusing only on small ranges of sizes means you’re leaving out a lot of users.

Rotate

A common problem with mobile apps—and less so with mobile websites—is that they don’t rotate.

A website should rotate to be usable in either the vertical or horizontal screen orientation. Sure, it’s nice to be able to design for one orientation, but an issue we have is pull-out keyboards, as you see in Figure 8-12.

For phones with a pull-out keyboard, the site must be usable in the horizontal orientation.
Figure 8-12. For phones with a pull-out keyboard, the site must be usable in the horizontal orientation.

On phones with a pull-out keyboard, apps and websites can only be viewed in horizontal orientation (unless you don’t need to use the keyboard).

It’s also frustrating to users to tell them a website isn’t available when they’re holding their devices in their preferred orientation, such as in Figure 8-13. Again, remember that it’s up to the users to choose their devices and how they hold them; it’s up to you to make the site responsive to accommodate the users.

Some sites require that they be viewed in a particular orientation.
Figure 8-13. Some sites require that they be viewed in a particular orientation.

Accessibility (Universal Design)

Universal design is the concept that resources should be usable by the widest possible spectrum of users, rather than just the average user.

This encompasses the idea of accessibility, which primarily means making sure your website is usable by users with physical and cognitive disabilities. But you also want to make sure your website is easily usable by older users, people for whom your website is not in their first language, and those using outdated or nontraditional equipment to access the site.

But the word universal implies everyone, and indeed if you make your website more accessible for users with disabilities, you’re making it generally more accessible for everyone.

We’ve addressed accessibility throughout the book, and it should definitely be a consideration throughout the web design process. But for now we’ll talk about the various types of access that you need to pay attention to, and some major points to think about.

Note

There’s much more to accessibility than we have space to cover in this book. To learn more about accessibility, check out Just Ask: Integrating Accessibility Throughout Design (http://www.uiaccess.com/JustAsk/) by Shawn Lawton Henry, which is available to read online for free, or Katie Cunningham’s Accessibility Handbook (http://shop.oreilly.com/product/0636920024514.do).

Visual

Because most of us think of using a computer or mobile device as primarily a visual experience, it stands to reason that one of the main impediments to using a computer or mobile device is not being able to see the screen, or not being able to see it well enough.

Screen readers

As an example, users who are blind access the Web using software called a screen reader, which reads the text that’s on the computer screen out loud to them.

Using correct, semantic HTML (which you should do anyway) is the first step for making your site accessible. If you’ve used semantic HTML to code your site, correctly tagging elements like headings, navigation, and forms, it will be much easier for the user to navigate the site—even without being able to see what it looks like!

We’ve already mentioned screen readers several times in this book, and in other chapters we talk about a few things you need to do to make sure your site is accessible to users who are accessing it with a screen reader.

To get a better idea of how a blind person would hear a web page being read out loud, download the Fangs Screen Reader Emulator (https://addons.mozilla.org/en-us/firefox/addon/fangs-screen-reader-emulator/), an add-on for the Firefox browser from Peter Krantz.

Note

Want to hear what it’s really like to use a screen reader? Check out the blog post “Things I learned by pretending to be blind for a week” (http://blog.silktide.com/2013/01/things-learned-pretending-to-be-blind-for-a-week/), where David Ball, who is not blind, tells about the week he spent browsing websites with a blindfold and a screen reader to see what it’s like.

Text size

Although blind users will comprise a very small part of the audience for most websites, a much larger number of users will be low-vision. The technical definition for this is someone who can’t read a newspaper at a normal viewing distance, even with corrective lenses. For the purpose of this book, I’ll make it a little broader and we’ll define it as anyone who has trouble reading a computer screen while browsing the Web.

And this includes more people than you think.

Vision naturally worsens as we age. In particular, visual acuity (sharpness of vision) for things that are up close starts to decrease around age 40 (hence why a lot of older people use reading glasses).

This means that many users—especially, but not only, older users—tend to have trouble seeing what’s on their computer screens. Walk through any office where there are older workers, and you’ll see some of them are squinting at the screen, leaning in, trying to read type that’s too small.

So that’s something to think about when you create websites: make sure everything is of a size that is easy to read—not just for you, but for most users. We’ll talk about this more in Chapter 9.

Also make sure that your code doesn’t do anything that would keep users from adjusting the size of text on the page—for example, using the user-scalable=no attribute on the meta viewport tag, which we talked about in Chapter 3.

Color contrast

The color of the text on your website has a significant effect on its legibility.

Black text on a white background is straightforward and classic, but you may want to get a little more interesting.

However, you need to keep in mind that people visiting your site may have difficulty reading text if there isn’t enough contrast between the background color and the foreground color. This will include users with low vision, including many older users, and also users who are color-blind. Even for someone with perfect vision, low contrast can be a problem when trying to read on a tiny mobile phone screen with light glaring on it.

Keep in mind that the visual design of your site is meant to sit on top of your content, not overwhelm it.

The Web Content Accessibility Guidelines (WCAG) recommends that the contrast ratio of text color to background color is at least 4.5 to 1. For large text, such as headlines, the contrast ratio needs to be only 3 to 1, because it is easier to read large text with less contrast. For more information on this, see “Understanding WCAG 2.0 - Contrast (Minimum)” (http://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html), from the W3C.

You generally won’t be able to tell if the contrast is acceptable just by looking, but you can use an online tool such as the Color Contrast Checker (http://webaim.org/resources/contrastchecker/) from WebAIM to check if there is enough contrast between two colors. You simply enter the hex codes of the two colors, and it will tell you the contrast ratio and whether it passes or fails for both normal and large text.

Another tool is Color Contrast Check (http://snook.ca/technical/colour_contrast/colour.html) from Jonathan Snook. After entering the numbers, it lets you play around with sliders to adjust the RGB settings, hue, saturation, and value of the colors, to see how you can get to a set of colors that passes.

To check everything on your website all at once, use CheckMyColours (http://www.checkmycolours.com) from Giovanni Scala. It will test every single element on a web page and give you a list of which colors pass and which fail.

Even gray can be a problem. It’s trendy for text to be gray instead of black—it looks more elegant—but it’s often hard to read.

The text in Figure 8-14 is pure black (#000000), and two shades of gray (#777777 and #AAAAAA). Both of the grays fail the contrast test.

The two shades of gray text fail the contrast test.
Figure 8-14. The two shades of gray text fail the contrast test.

Color blindness

Another thing to think about when using color on a website is making sure you’re not creating problems for color-blind users.

People who are color-blind don’t just see everything in shades of gray; that type of color blindness is very rare. Rather, there are certain colors that are not distinguishable. For example, the most common type of color blindness is red–green, in which shades of red and shades of green look similar.

This means that looking at a stoplight, the red light and the green light look like similar colors. But color-blind people can still drive, because they know that the red light is always at the top and green at the bottom, even if they look the same. In that case, position is used to convey meaning, as a backup to the meaning conveyed by color.

You need to do the same thing for your website. Use color for visual decoration as you wish, but if you’re using color to convey meaning, you need to include an alternate method.

For example, you might have a chart that uses red and green to note which features are available in a comparison of products. You could, at the same time, use Xs and checkmarks to convey the same information. The color will look compelling—perhaps showing at a glance that your product has far more green checkmarks than the competitor’s product—but someone who can’t interpret the colors will still be able to use the Xs and checkmarks to understand the chart.

When color is a key part of the website content, you need to provide enough information so that the user can make accurate choices.

For example, an online shopping site that sells shirts should make sure to label the colors, rather than just providing colored squares to demonstrate the color options. Also, use accurate color names. One popular clothing website lists color names such as “sugar coral” and “cloudburst.” Although they make the clothes sound intriguing, those meaningless names certainly won’t help customers who can’t distinguish the colors on the screen.

To learn more about how color blindness affects website users, with a lot of great examples of how to make sure your site is compliant, see Geri Coady’s blog post “Colour Accessibility” (http://www.24ways.org/2012/colour-accessibility/) on 24 Ways.

Audio

Most of the Web is visual, but there are also bits that are audible, such as videos and audio clips. For users who are deaf or hard of hearing, this information needs to be presented in a different format to be accessible.

Videos should have captions whenever possible. Unfortunately, although creating videos requires very little technical skill (pretty much anybody can do it), captioning is quite a bit more difficult. If you aren’t able to caption videos, providing a transcription is an alternate option. It’s not as good, because the user can’t match the visual images with the words at the same time, but it’s better than nothing.

Audio clips should, of course, have a transcription.

This doesn’t only help users who can’t hear the content. Other users may just prefer to read rather than listen (it’s faster), or perhaps they are in a loud location where it would be hard to hear the content, or a quiet location like a library where they can’t play the audio out loud and they don’t have headphones.

Input Methods

Although users with visual disabilities are the most obvious category of people who use assistive devices to access the Web, there are also people who have no trouble with vision, but who can’t physically use a keyboard and/or mouse in the same way that most of us do.

Keyboard only

Some users are able to use a keyboard, but are physically unable to use a pointing device like a mouse. This might be due to something as common as carpal tunnel syndrome.

Blind users also fall into this category, because they can use a keyboard by feel, but can’t use a pointing device because they aren’t able to see where the pointer is on the screen.

And some power users just prefer to use a keyboard instead of a mouse because it’s faster than switching back and forth.

By default, HTML makes web pages fairly accessible to keyboard-only users. But you need to make sure you don’t do things that take away this accessibility.

Keyboard-only users navigate through the elements on a screen by using the Tab key. It takes them from one selectable element to the next (form fields, links, etc.), and the selected element is visually highlighted when they are on it. Try going to a website and hitting Tab several times—you’ll see that each link on the page is surrounded by a dotted line when it is selected. If you hit the Enter key, it’s the same thing as clicking that selected link.

The tab sequence will follow the same order as your HTML, which is another good reason to make sure your HTML is written in a logical order.

For users who are navigating by keyboard and can’t see the screen, elements need to be labeled clearly. For example, a link should describe what is behind it, rather than using a generic “click here.”

Speech recognition software

Users who can’t interact with a keyboard at all might use speech recognition software, which allows them to speak commands to the computer.

Generally, if you make your site accessible for keyboard-only users, it will also be accessible for speech recognition users. But an additional consideration is making sure that form fields and links have unique labels, allowing the voice user to easily select them.

Cognitive Disabilities

People with cognitive disabilities are an often-ignored portion of a website’s user base.

Providing clear and simple language, which we talk about in Chapter 2, is a great start to making your website more accessible to these users. This also helps users for which your website is in a language other than their native language.

You can also help users by having consistent design patterns throughout the site, such as using the same navigation options on each page. If you redesign a website, some users will have to “relearn” how to use the site—it’s not simply a matter of finding where different things have moved to.

Another issue is animated graphics, which can be distracting for users with dyslexia or ADHD. It’s best not to have anything on a web page animated by default, and make sure you don’t use animated GIFs to communicate information, as some users use browser settings to turn off animations entirely.

Deciding Which Devices to Support

The tricky part of responsive design isn’t just designing for different screen sizes. After all, you can easily design and test media queries just by changing the size of your browser window. The difficult part is making sure your site works on the widest possible variety of devices. Just because your website looks good when you resize your browser window doesn’t mean that issues won’t crop up on certain devices. Besides the fact that browsers don’t all support the same features, every device and browser has little quirks.

When you start a project, you need to decide which devices you will support with the site design. This doesn’t mean that these are the only devices the site will work on; it just means that those are the only devices you are agreeing to test to make sure the site works.

While responsive sites are designed to work on any size or type of device, there are occasional quirks that might make something go wrong, and you can’t realistically test on every device out there. So, you need to select a list of devices and browsers to test on that are generally representative of the common devices, operating systems, browsers, and viewport sizes.

Here’s an example of a list of devices and browsers you might include in the project plan for a website:

  • Computers running Microsoft Windows 7 and newer

    • Internet Explorer 9 and newer

    • Latest releases of Firefox, Safari, and Chrome

  • Computers running Mac OS X 10.7 Lion and newer

    • Latest releases of Firefox, Safari, and Chrome

  • Tablets and smartphones running Android 4.0 Ice Cream Sandwich and newer

    • Chrome on Nexus 7 tablet

    • Chrome on LG and Motorola smartphones

  • iOS 6.0 on iPhone 3GS

    • Mobile Safari

  • iOS 7.0 on iPhone 4s and 5, iPad 2, and iPad mini

    • Mobile Safari

    • Chrome for iOS

The exact devices on your list will depend on the needs of the project. For example, the preceding list doesn’t include Blackberry or Windows Phone devices. The stats for your existing site might tell you that you have a very low number of visitors using Blackberries, so you may decide it’s not worth your time to include those devices. But keep in mind that if the existing site doesn’t work well on certain mobile devices, statistics may mean that users with those devices are just avoiding your site, while they might turn into regular users if the site worked correctly for them.

You should also find out what particular device each of your stakeholders uses, and make sure you’re testing on that device, even if it’s obscure. No matter what devices are on the list, your stakeholders are going to expect that the site will work on their own phones.

Why Use Real Devices for Testing

Just because you are planning to support a list of particular devices, it doesn’t mean you have to actually own all those devices. You can use online emulators and simulators to see how the site will look on various devices (more on that in the next section).

However, although using an emulator from your desktop browser will let you see how the site looks on various devices, it won’t give you a feel for the user experience of the site. For example, are your touch targets large enough? Is it easy to move between sections of content? Does the site load quickly enough on a slow mobile connection?

If you can’t obtain all the actual devices you want to test, at the very minimum you should test on an iPhone, an Android phone, an iPad, and a 7” tablet (either an iPad Mini or an Android device). That’s in addition to the major browsers on both Mac OS and Microsoft Windows.

Device Labs

If the world was perfect, every company that makes websites would have a device lab, a collection of a wide range of mobile devices that designers and developers could use to test the websites they’re working on. But unless you work at a large company with a big equipment budget, you’re probably not that lucky.

You can probably ask around and come up with at least a few coworkers who will let you borrow their phones, but they’re likely to have similar devices, and you probably won’t find all the device types you want to test on.

The open device labs that have started cropping up in the past few years are one solution. An open device lab is a place where you can find a collection of mobile devices that are available for the community to use. Some device labs are owned by web agencies or other companies that have generously made their labs open to the public; others are community organizations or nonprofits that rely on donated resources.

There are open device labs in cities around the world, although most are located in major cities of Europe and the United States. You can find a list of device labs on OpenDeviceLab.com (http://opendevicelab.com).

What you will find in a device lab will vary. Some labs may only have a few devices, while others may have several in a wide range of operating systems and form factors (physical interfaces). Some device labs charge a small fee for access, but many are free.

Buying Devices

Although it sounds expensive to buy devices to use for testing, there are ways to get some of them cheaply.

Having to pay for a cellular plan to go along with each phone can be prohibitively expensive, but many phones can be used on WiFi without having to pay for a cellular plan. This is generally adequate for testing purposes, although it won’t allow you to test performance over a mobile connection.

You can get many older phones used off of eBay, Craigslist, or other sale websites, or even ask friends and coworkers. Not all mobile providers have a way to “trade in” your old phone when getting a new one, so people tend to just stick their old phones in a box in the closet, as it just doesn’t seem right to throw away that once-expensive piece of equipment.

You probably already have, or can easily borrow, both an iPhone and an Android phone; it’s worth having a 7” tablet and a 10” tablet on hand for testing too, so you can get a feel for actually using a website on that size screen, as opposed to just viewing it on an emulator.

Testing

A key to successful responsive design, as we’ve mentioned throughout the book, is testing your site on various devices. Besides using actual devices, there are other ways to test your site to make sure it will work correctly on the widest range of devices.

Validators

One of the first things you should do to test your site is validate your code. This can catch code errors right off the bat, and save you a lot of time troubleshooting things that don’t display correctly.

Validation tools are built into web developer add-ons for major browsers, or you can use an online service to validate your code, such as the W3C Markup Validation Service (http://validator.w3.org) (for HTML) and the W3C CSS Validation Service (http://jigsaw.w3.org/css-validator).

Browser Resizing

As you’re designing or coding a responsive website, you’ll certainly be resizing your browser window to see how the design looks at different viewport widths. Although this is useful—and where you should start—it’s not necessarily going to give you an accurate picture of what the site will look like on actual devices.

However, browser window resizing gives you an advantage you don’t get on mobile devices: you get to see how the design looks at every possible viewport width, not just the widths of whichever devices you test on. And no matter how many devices you test on, you’re not going to be seeing every possible device width, so the browser window may be the only place you can see some weird layout quirk that happens only between 643 and 647 pixels.

Browser tools

When you start your testing in the browser, there are a few tools you can use to make the job a little easier.

Although changing the window size gives you an idea of how the design looks across all viewport widths, you’ll also find it useful to see the site in the exact size of common devices.

In Firefox, this is easy; there’s a built-in tool. Go to Tools → Web Developer → Responsive Design View, shown in Figure 8-15. After loading a page, you can use a drop-down menu to choose among several different preset screen sizes, and there’s even a button to allow you to take a screenshot of the web page.

In Safari, there’s an extension called Resize (http://resizesafari.com/) that lets you resize your browser window to configurable preset sizes.

For Chrome, try the Windows Resizer (https://chrome.google.com/webstore/detail/window-resizer/kkelicaakdanhinjdeammmilcgefonfh).

Responsive Design View in Firefox.
Figure 8-15. Responsive Design View in Firefox.

Browsers and Operating Systems

A few years ago, we only had to test our websites on two operating systems (Mac OS and Microsoft Windows) and a handful of browsers (Firefox, IE, Safari, and maybe Opera).

Now, however, there are several mobile operating systems and many mobile browsers to consider as well. Here’s a list of the major mobile operating systems and the default browser for each:

  • iOS (iPhone, iPad): Safari

  • Android: Chrome (newer devices) or Android Browser (older devices)

  • Windows Phone: Internet Explorer Mobile

  • Blackberry: Blackberry Browser

For each operating system, you should test on the most recent version of the OS, and if possible also test the previous major release, especially for iOS and Android.

You may also wish to test the Symbian OS that runs on Nokia devices; it was the most popular OS worldwide until 2010, and many Symbian phones are still in use. Several open source mobile operating systems are also available, including Firefox OS, Sailfish OS, and Ubuntu Touch OS.

The Kindle Fire runs Fire OS, which is a custom version of Android.

Every mobile phone comes with a default browser, such as the ones just listed, and many users don’t even realize that they have the option to install other browsers on their phones, just as they would on a desktop computer. Besides the default browsers already listed, you may want to test:

  • Dolphin Browser (Android, iOS)

  • Chrome (Android, iOS)

  • Firefox for Mobile (Android)

  • Opera Mini (Android, iOS, Blackberry, other device types)

  • Opera Mobile (Android, other device types)

And don’t forget about desktop computers. In addition to testing on both Microsoft Windows and Mac OS X, make sure to test on all the major browsers:

  • Chrome (Mac OS X, Microsoft Windows)

  • Firefox (Mac OS X, Microsoft Windows)

  • Internet Explorer (Microsoft Windows)

  • Opera (Mac OS X, Microsoft Windows)

  • Safari (Mac OS X, Microsoft Windows)

Emulators and Simulators

If you don’t actually have a particular device, you can still test on that device by using a mobile emulator or simulator, which will allow you to use your desktop monitor to view what your site would look like on a particular device.

The difference between an emulator and a simulator is that the former will show you how the device would behave, while the latter only shows you what the device’s screen would look like.

Many of the mobile operating systems and manufacturers have emulators or simulators you can download; check out Maximiliano Firtman’s “Mobile Emulators & Simulators: The Ultimate Guide” (http://www.mobilexweb.com/emulators) for an extensive list.

However, rather than having to download a lot of different software, you may find it easier to use a browser-based tool that will allow you to test many devices or operating systems at once.

Two of the most popular and comprehensive are BrowserStack (http://www.browserstack.com) and Cross Browser Testing (http://crossbrowsertesting.com). These have a monthly fee based on users or usage. You can find many others, some free, by searching the Web.

Assistive Technology

Don’t forget that some users will be coming to your site using assistive technology, such as screen readers.

To make sure these users are able to access your site, you should test in at least one screen reader. If you don’t have the budget to buy any of the popular commercial software options, there are several free options available.

Mac OS X has a screen reader built into the operating system: Voiceover for OS X (http://www.apple.com/accessibility/osx/voiceover/).

You may also wish to try the Fangs Screen Reader Emulator (https://addons.mozilla.org/en-US/firefox/addon/fangs-screen-reader-emulator/), an add-on for Firefox.

Even before testing in a screen reader, you can start by viewing your site without the images—replacing them with the alt text—to see if the site still makes sense. Web developer add-ons for the major browsers will give you this option.

Summary

When creating a responsive website, you need to give a lot of thought to both your users and the devices they might be using. Although responsive design is not only about designing for mobile, it’s natural to focus more on mobile because it’s a less familiar medium, and because there are so many new capabilities and limitations to consider with mobile devices. Just don’t forget to make sure your design works well on desktop screens as well.

You shouldn’t design for particular devices, but rather create a design that will work well across all devices. By focusing on mobile first, it’s easier to make sure everything works well on the mobile interface.

Responsive design is not an all-or-nothing approach. If you don’t have the resources to make your site fully responsive, you can make it partially responsive, which is better than not responsive at all.

There are many different types of devices that can access the Web, from mobile phones and tablets to desktops, as well as other devices like ereaders and watches. Touch is one of the biggest changes now that we are designing for mobile devices. Make sure that your touch target sizes are large enough, and that JavaScript events work correctly on touchscreens.

You also need to make sure your site is universally accessible. There are a lot of details to consider, such as making sure that color-blind users won’t miss any important information that your site conveys with color.

Deciding which devices to support with your site will depend on your resources. It’s best to use real devices for testing, but if you can’t, there are other tools like simulators and emulators.

Now that you’ve been thinking about your users and the devices they are using, we’ll jump back into design. In the next chapter, we’ll look at typography for responsive websites.



[3] For the full report, see Maeve Duggan and Aaron Smith, “Cell Internet Use 2013,” Pew Research Internet Project, September 16, 2013 (http://www.pewinternet.org/2013/09/16/cell-internet-use-2013/).

[4] For the full report, see Susannah Fox and Lee Rainie, “The Web at 25 in the U.S.,” Pew Research Internet Project, February 27, 2014 (http://www.pewinternet.org/2014/02/27/the-web-at-25-in-the-u-s/).

[5] For more information, see Google’s Our Mobile Planet (http://think.withgoogle.com/mobileplanet/en/).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset