Professional Documents
Culture Documents
table of contents
inTroducTion 3
parT 6: images 12
parT 7: Typography 14
parT 8: navigation 16
conclusion 24
references 25
page 2
Responsive design best pRactices
inTroducTion
intRoduction
Theres no question that responsive design is the future but not all responsive sites are created
impressive
new mobile devices are being invented every day, which means websites must be designed with
multiple contexts in mind With responsive sites, one url will work on any and every device
to make your content look perfect on anything from a three-inch smartphone screen to a 30-inch
widescreen monitor
but responsive design isnt just about screen width its about device capabilities a good respon-
sive site will work just as nicely on a decade-old feature phone as it will on the newest tablet-laptop
hybrid
we believe this approach is undeniably superior, its only superior when its well executed This re-
-
tect you from pitfalls every step of the way from the design approval process to page load time
page 3
Responsive design best pRactices
undersTanding THe Mobile audience
parT 1
undeRstanding the Mobile audience
Dont take mobile too literally.
so your users have gone mobile: 60% of online devices are now mobile1 and 34% of us adults go online mostly
with their phones Youll want to cater to their needs by serving up content tailored to mobile activities so what are
mobile users up to?
crowded city streets as she walks, shes checking for nearby restaurants that will accept an impromptu happy-hour
gathering
in his article The Mobile context, british web developer Mark kirby provides common examples of how businesses act
on these misperceptions2:
im an airline My user is on a mobile They must be checking in ill remove access to booking and focus on check-
in features
im a shop My user is on a mobile They must be looking for a store ill serve up the address and a map, and ill
remove access to the shop
im a newspaper My user is on a mobile They must be on the move, so they only want to know the top three
stories
do it on their terms so make them feel at home if your site is frustrating to use on a small screen, you may never get
a second chance to show them what it looks like on a widescreen display
Mobile sometimes means mobile, but often it means stationary The real mobile user can often be found sitting on a
couch in front of his TV
stephen Hay, a dutch web designer, suggests letting the user decide what they want4 if you present your users with a
1 brennan 2013
2 kirby 2011
3 philogene 2012
4 Hay 2013 page 4
Responsive design best pRactices
conTenT sTraTegY
parT 2
content stRategy
three Rules of Mobile content
Mobile content should be three things: complete, simple, and clean
by complete -
plained in the previous section, its foolish to make assumptions about how your mobile users are interacting with your
site
and when we say clean, we mean that your content should be encoded semantically but not styled keeping your con-
tent separate from your style means that your content is ready to be reused anywhere
Keep it simple.
unnecessary complexity hurts your contents usability and not just because it takes up space on small mobile screens
complexity isnt what your users are after in fact, studies show that your users arent reading every word of your content
from top to bottom theyre scanning
This has been common knowledge in the tech writing community since the 90s just ask Jakob nielsen His research
found that 79% of users scan new web pages and only 16% of users read the content word by word5
in that same study, nielsen points out three ways of making your content work better for web users:
1. be concise. concise content doesnt mean leaving out any important information; it means removing unnecessary
words, ramblings and information your users dont need
2. scannable layout. nielsen added bullets in his study, but this also means adding formatting (for example, bold
and italic), breaking up large paragraphs, and adding clear sections
3. objective language. nielsen recommends removing marketeseby which he means promotional writing avoid-
ing marketese is really about being concise promotional text done poorly is full of information that users dont
want
another thing to consider: keeping it simple means ditching anything unnecessarily complicated browser-based plug-ins
are an obvious no, but you might also want to consider how you incorporate video or audio content
its possible to make these features work on mobile, but include a description of what information theyll cover, and keep
these presentations short
in order to provide your mobile users with the best experience possible, it can be helpful to examine cases of weak
responsive design
The architecture of the starbucks site seems to ignore commonly searched keywords, making it harder for users
although the Microsoft mobile site allows you to select downloads in its menu, you cant actually download any-
thing instead, youre taken to a page about getting the Most out of Your pc which is irrelevant, because youre
on a mobile device
6 How common are seo problems with responsive Web design? page 6
Responsive design best pRactices
design coMping
parT 3
design coMping
the problem with comping
The traditional design process is pretty straightforward: first, an interview Then some design research and some
responsive design requires a more sophisticated approach You have to think about how your site is going to render on
a variety of devices, and no client has the budget or the patience to go through a pixel-perfect comp process for every
plus, theres no great way to accurately depict the behavior of your responsive site in photoshop comps
a Better alternative
comping isnt going to work for your responsive site so heres what we recommend instead:
1 start by gathering information through interviews and research the same way you always do, and then move into
2 but rather than producing a series of comps, present something more abstract, like a style guide or mood
board You can assure the customer youll get them to about 90% accuracy on their vision of the site
3 once theyre happy with the look and feel of what youre presenting to them, youll create live responsive
screens
page 7
Responsive design best pRactices
Media Queries
parT 4
Media QueRies
Responsive design is powered by media queries.
You cant talk about responsive design without talking about media queries media queries are the main technology
The term media is a bit vague, but the most common application of media queries is to test for screen width for exam-
ple, for a screen thats 1200px wide, you might want a four-column layout for your site, but at 320px, you probably want
a one-column layout Media queries make these kinds of customizations possible
screen width is just the beginning You can also use media queries to test for things like type of device (such as TV,
smartphone or tablet) and even the orientation of the device (portrait or landscape)
in your HTMljust as you would link to any css stylesheet for example:
as far as linking a media query is concerned, you can also add a media query directly to a css stylesheet:
in this example, if the browser has a screen width of 800px or below, then the sidebar class has the property display:
none
page 8
Responsive design best pRactices
Media Queries
now that you know how to add a media query to your site, here are some common examples of types of media queries
to get you started
Targeting screen width is probably the most common usage for a media query To target screens at a certain width and
below, use max-width:
You can use that method to apply custom css when your site is viewed on smaller screens such as phones or tablets
To target screens between certain widths, combine min-width and max-width with the and operator:
Targeting screens between certain widths is useful when you have several media queries
for more information on media queries check out the Mozilla Developer network and the Moboom Blog
page 9
Responsive design best pRactices
Media Queries
are all these queries and breakpoints really necessary for responsive design?
web experiences for your users doesnt mean you should Too many designers create websites with all the responsive
Web designer brad frost puts it nicely when he says: dont feel like you need to include 750 media queries and jump
and often, all that means is a couple of simple media queries nothing fancy Just enough to make sure your text is com-
fortable to read on a mobile device
2. instead, create layouts based on content. The most future-proof breakpoints are based on content consider
3. theres no need to break your site. Media queries are powerfulthey can make major changes in your sites
layout but in most cases, a little goes a long way: small, subtle changes can take your site from web to mobile for
example, maybe all you need to do is condense the navigation menu
parT 5
fluid gRids
a Better Resolution solution
with media queries fluid grids are composed of columns, and they use percentages to determine what the width of
each column should be While 20% of a desktop-sized monitor might look okay, 20% of a phone screen probably looks
-
umns for a desktop-sized resolution and one column for phone-sized resolution
You can read more in ethan Marcottes excellent Fluid grids article for A List Apart
pick a framework.
Theres no need to reinvent the wheel: unless you want an incredibly customized site, you dont have to design your
Bootstrap
page 11
Responsive design best pRactices
iMages
parT 6
iMages
some Basic image tips
critics of responsive web design point to the poor performance of some responsive sites These performance problems
are almost always a result of lazy image handling images are one of the trickiest parts of responsive design, but these
recommendations can help you handle them:
Whenever possible, use icon fonts This is the most scalable solution for icons and non-content images keep in
mind, though, that icon fonts may not work on lower-end devices
images should be resized properly that is, on the server You cant rely on just the browser to scale big images
on a smartphone
Flexible images
max-width to 100%8:
That way, the image will never be wider than the browser scaling up doesnt work as well as scaling down, so youll want
to start with a larger image and scale it down
The max-width property doesnt work for older versions of ie, so add:
scaled-down images look choppy in older versions of ie To make these images look pretty in ie, add9:
8 smashing Magazine
9 (css Tricks) page 12
Responsive design best pRactices
iMages
and phone screens in some cases, that makes sense but sometimes you might want to crop instead of resize an image
for a smaller screen or you might want to use a smaller image because of bandwidth concerns
css
tricks10 article for some help picking one out We like the method proposed by Harry roberts11 because it avoids Java
script, which isnt always mobile friendly
besides making designing your site simpler, using css instead of images whenever possible will decrease your sites load
10 csstricks com
11 csswizardry com
12 W3schools com page 13
Responsive design best pRactices
TYpograpHY
parT 7
typogRaphy
vertical Rhythm
Vertical rhythm refers to the spacing and organization of text as experienced by viewers as they read a webpage There
are three factors that determine vertical rhythm:
font size. Youll start by choosing a font size; lets say its 12px
spacing between lines. To ensure readability, the body text will need some leading a line-height of 1 5em would
give 6px spacing between the lines of body copy 13
line height. You can determine a basic line height unit once you know the font size of the body copy and the line
spacing in this example, you have a total line height of 18px
The image below is from Wikipedias page on the principles of grouping notice how your mind decides that the dots on
the left are one group and the dots on the right are three groups
With the law of proximity in mind, youll be able to design your site in a way that takes advantage of peoples natural hab-
its of perception for example, youll be sure to position headings closer to the text that they describe
lets also consider the gestalt law of similarity, which states that people tend to psychologically group things that re-
semble each other
This image shows you how your mind automatically groups the dots into separate horizontal lines by color
techniques
page 15
Responsive design best pRactices
naVigaTion
parT 8
navigation
navigation challenges
navigation menus are crucialthis is the primary place where users interact with your site navigation menus can be
especially challenging for mobile design because of small screen sizes
navigation solutions
pattern:
Try to avoid hiding or pushing down all the content on your mobile homepage This is particularly a concern with
simple top, toggle, and block dropdown patterns
if you choose not to provide prominent links to certain areas of your site, make sure your analytics support your
decision to make this content less visible
desktop users want links that were built for a mouse, while phone and tablet users want links that were built for a
touch screen so design mobile navigation for touch, and be sure to test on actual devices
check out some gorgeous navigation menus in our blog post, and learn more about patterns at adventures in Respon-
sive navigation
page 16
Responsive design best pRactices
daTa Tables
parT 9
data tables
Data table challenges & solutions
fortunately, there are a number of solutions our favorite is chris coyiers approach: reformatting the data so that each
row of a table appears as a table itself whenever a smaller screen is detected
page 17
Responsive design best pRactices
feaTure deTecTion
parT 10
featuRe detection
Modernizr
adapting your site to features along with layout is the next stage of responsive web design, and Modernizr provides you
with plenty of tools to get started
Modernizr is a Javascript library that detects the HTMl5 and css3 that are in the users browser Modernizr has two
important functions:
1. Modernizr tells you which css3 features the users browser supports. This means that you can customize
2. Modernizr enables styling for htMl5 elements in older browsers such as ie 6 through 8 This means that you
can write css for HTMl5 elements without worrying about what an older browser can support
a better approach is to detect the features of a device and customize the content based on those features Thats where
Modernizr comes in
Moboom com runs Modernizr so if you view its source, youll see that the <html> element starts out with the class no-js:
<html class=no-js>
page 18
Responsive design best pRactices
feaTure deTecTion
next, if you view the rendered HTMl, youll see that the <html> element has additional classes, and the element prob-
ably looks something like:
Modernizr is a Javascript library, so if the device running your site doesnt support Javascript, then no-js remains un-
changed (you can create css styles for that class)
if the device does support Javascript, Modernizr runs tests to detect which features are supported The results of these
tests are returned as classes in the example above, you can see that the browser supports the flexible box Model
returned)
for detailed information on which feature corresponds with which class, check out the Modernizr documentation
justify-content: space-around;
}
page 19
Responsive design best pRactices
feaTure deTecTion
.wrapper li {
margin: .5rem;
color: SteelBlue;
font-size: 3rem;
font-weight: bold;
text-align: center;
}
To create two separate looks, just add styles for the touch class remember that if the browser supports touch events,
then Modernizr will add the touch class to the <html> element so to create touch-friendly buttons, just add:
html.touch .wrapper li {
height: 10rem;
line-height: 10rem;
background-color: SteelBlue;
color: white;
}
html.touch .wrapper {
if you open the page on a touchscreen device, Modernizr applies the touch class if your browser doesnt support touch
events, Modernizr applies the no-touch class With Modernizr and some basic css, you can quickly create pages that
adapt based on the supported features
for example, to test if touch events are supported, you could use:
if (Modernizr.touch) {
$touchy=Touch me!
} else {
page 20
Responsive design best pRactices
perforMance
parT 11
peRfoRMance
page Load time
When youre designing a site that will run on mobile devices, page load time is a huge issue Mobile connections may be
spotty and slow, but users wont accept that as an excuse studies show that more than half of users will abandon14 a
site after waiting three seconds for it to load
1. eliminate the unnecessary: start with what is absolutely essential, and progressively enhance from there
2. separate secondary content: put your core content on one page, and link to separate pages for secondary con-
tent
3. dont hide elements: This is a common practice on a lot of responsive sites but if something isnt going on the
page, why download it? use conditional loading15: load items only when requested, or when the conditions are
right
optimize your code. steve souders has some excellent solutions, and also consider:
2. optimize your css by following a list of recommendations that include: avoid a universal key selector, make rules
4. Dont add css directly onto a page: instead, add any css through the site styles page, the Widget styles page
or in the styles tab of a widget When you add css directly onto a page, the css wont load in the pages Head,
which means the page will take longer to load
use a cdn: global content delivery networks bring more users closer to servers, which has a direct impact on load
times
14 strangeloopnetworks com
15 24Ways com page 21
Responsive design best pRactices
TesTing
parT 12
testing
take your site for a test drive.
The best way to make sure your website is ready for users is to imagine that youre a user and explore your site inside
and out, in every context imaginable from a user who has lots of questions and is accessing your site on a desktop
using ie to a user whos in a big hurry and is accessing your site on the latest android device, youve got a lot of roles to
play
an open device lab is a great resource for real-device testing if youre in the san francisco bay area, come check
out Mobooms own oDL
Youll want to test on common mobile browsers like the android default browser, firefox for android and the ios
browser
page 22
Responsive design best pRactices
TesTing
test it yourself.
no matter what browser or device theyre using, everyone needs a smoothly functioning site thats easy to read so make
sure to:
page 23
Responsive design best pRactices
conclusion
conclusion
thank you for reading!
Weve covered a lot in this ebook among many other things, weve established that:
its foolish to make too many assumptions about what mobile users want to do on your website
Keep your content clean, that is, separate from the structure of your site
comping has outlived its usefulness When designing responsively, use a combination of mood boards and live
responsive screens instead
Media queries are powerful tools but that doesnt mean you should load your site with them use them intel-
ligently and sparingly
vertical rhythm and gestalt principles are still relevant typography principles
There are lots of navigation options to suit your content, but keep all content accessible and design for touch
keep device features and input in mind Modernizr makes it easy to adapt your content
Minimizing your page load time is crucial more than half of users leave a web page after waiting three seconds
for it to load
before your site goes live, testing is a must on various browsers, on various devices, and with various users
responsive design, check out Moboom University Were always updating our tutorials
Try Mobooms ground-breaking responsive design platform for yourself claim your free site now to get started
page 24
Responsive design best pRactices
references
RefeRences
1 How common are seo problems with Responsive Web Design? brian Meuner, 2013
4 global mobile statistics 2012, & global mobile statistics 2013 part a Mobithinking, 2012
5 global trends in tablet and smartphone use while watching tv nielsen, 2012
10 Which responsive images solution should you use? chris coyier, 2012
16 How to optimize Your Headlines for google and Humans Jonathan rick, Mashable
page 25