Responsive Design Fundamentals

Responsive Design Fundamentals

with James Williamson

 


Web projects need to work across multiple devices, screen sizes, and browsing contexts. Web designs need to be responsive to these variables, providing an optimal viewing experience for each scenario. In this course, author James Williamson introduces responsive design to new web designers and fills in any gaps experienced designers may have, while providing a deeper exploration of how current trends in devices, connectivity, and user experience are driving its adoption. The course covers concepts like screen density, fluid grids, and responsive images, as well as actual design strategies that guide you from mock-up to testing.
Topics include:
  • What is responsive design?
  • Controlling viewports
  • Designing for multiple screen densities
  • Working with media queries
  • Using fluid grids
  • Building responsive forms
  • Optimizing site performance
  • Building responsive mockups
  • Developing a content strategy
  • Designing for mobile capabilities
  • Creating flexible HTML
  • Testing responsive designs

show more

author
James Williamson
subject
Web, Responsive Design, Web Design, Web Foundations
level
Beginner
duration
2h 15m
released
Oct 31, 2012

Share this course

Ready to join? subscribe


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:00(music playing)
00:04Hi! I'm James Williamson, senior author here at lynda.com, and I want to welcome you to
00:09Responsive Design Fundamentals.
00:11Over the last few years, we've seen a fundamental shift in how people consume online content.
00:16The rise of smartphones, tablets, and other connected devices means that designing your
00:21sites for a fixed screen size is no longer a best practice.
00:25With that in mind, I've designed this course to introduce you to the basic concepts, terminology,
00:30and strategies for creating responsive designs.
00:33We'll start by exploring some of the basics of responsive design: what it is, why it's
00:37important, and how a typical responsive site behaves.
00:40Next, we'll tackle some of the common concepts and techniques of responsive design, such as
00:46the mobile viewport, working with media queries and fluid grids, and how to improve site performance
00:52for responsive sites.
00:54After that, we'll discuss different strategies that can help guide your approach to responsive
00:58design and give you a better idea of the issues that you'll face as you adopt a responsive design workflow.
01:03So with that in mind, let's dig a little deeper into responsive design.
01:07
Collapse this transcript
Who is this title for?
00:00responsive design is a growing movement in the web design community, but it's still at
00:04the early stages of its development,
00:06and many of the concepts and techniques behind it are still evolving.
00:10I've created this course as a way of introducing what responsive design is and what you should
00:15focus on if you choose to begin building responsive sites.
00:19Since the format of this course is a little different than some of my other courses, I
00:23thought I'd take a few minutes to describe what this course is and whom it's designed for.
00:29As part of the Fundamentals series, it's designed to give you a high-level overview of responsive
00:34design and the techniques, concepts, and strategies behind implementing it.
00:39You'll note that this course has no hands-on exercises.
00:43It's simply designed to introduce you to responsive design and help you understand what's involved
00:48in creating responsive sites.
00:50As such, this course assumes a basic level of knowledge with the concepts surrounding
00:55HTML, CSS, and JavaScript.
00:58Beginning web designers can certainly expect to come away from this course with a better
01:02understanding of what responsive design is, but much of the course is designed to give
01:07experienced web designers a clearer picture of how responsive design works.
01:12So if you're brand new to web design, don't be surprised to hear me reference a few terms
01:16and concepts that you're unfamiliar with.
01:18For those of you who are experienced designers, this course is a great place to start if you're
01:23curious about responsive design and want to learn more about it.
01:26Although the course isn't hands-on, there are enough syntax examples, concepts, and
01:31helpful resources to get you started building responsive designs as soon as you finish the course.
01:37I hope this gives you a clearer picture of what to expect from this course, and with that,
01:41let's go and learn more about responsive design.
01:43
Collapse this transcript
1. Introducing Responsive Design
What is responsive design?
00:00One of the biggest challenges faced by web designers is the lack of control that they
00:04have over their medium.
00:06Take print design for example.
00:08If I'm designing this magazine layout, I'll need to deal with variables such as paper
00:13stock, what type of press it's printed on, and which inks I'll use.
00:17While these choices may influence my design decisions, I'm still designing for fixed dimensions.
00:23I'm largely in control of the entire process, and the people that consume this content will
00:28experience it in exactly the same way.
00:31Now, contrast that with web design.
00:34When I create content for the web, I have to deal with an almost overwhelming set of
00:39variables in how that content will be consumed.
00:42For example, I have to consider the wide variety of browsers and operating systems that people might be using,
00:48whether my content is accessible to screen readers or other accessibility-enabled devices,
00:53how my content will look if and when it's printed, or whether they're attempting to access
00:57my content on any one of the growing number of diverse web-capable devices that don't
01:03really resemble the traditional screen and browser configuration.
01:07Of course, the change that's been getting the most attention recently is mobile.
01:12The recent explosion of clients accessing the web on mobile devices has made designing
01:16for the mobile screen a requirement, not an additional consideration.
01:21But mobile is only part of the story.
01:23As you can see by the small sampling screens that I have here, screen sizes are not only
01:27getting smaller, they're getting bigger as well.
01:31That means that as a designer, trying to design separately for each context that your content
01:35might be encountered in is almost impossible.
01:38That's where responsive design comes in.
01:41Responsive design is a design strategy that is centered on designing your content so that
01:46it responds to the environment it's encountered in.
01:49The term was first coined by Ethan Marcotte who identifies three fundamental techniques
01:54for responsive design: fluid grids for flexible layouts, media queries to help you adapt content
02:01to specific screen sizes, and flexible images and media that respond to changes in screen sizes as well.
02:09For the most part, Ethan's sticking to his guns on those three techniques defining what responsive
02:13design is, but like most new terms, its meaning is still evolving.
02:18Many people are using it to refer to any techniques or strategies that allow designs to respond
02:24to different environments.
02:25I feel it's a very broad term and one that can encompass almost anything that frees your
02:30content from the restrictions of a single context.
02:34To me, learning and understanding responsive design is less about learning specific techniques
02:39and more about changing the way that you think about designing for the web.
02:43It means totally rethinking content strategies, taking more time to consider how people might
02:48use and access content based on specific context, and how to take advantage of the diverse capabilities
02:54of the different devices that your audience is likely to use.
02:58To that end, I think you'll find that embracing responsive design will dramatically change
03:02the way you plan and execute your sites.
03:05
Collapse this transcript
Exploring the need for responsive design
00:00Over the years, we've seen a lot of web design trends come and go.
00:04In fact, I'd say the one constant in the field of web design is change.
00:09With so many new developments and techniques cropping up, it's sometimes hard to keep track
00:12of what's important and what's not when you're deciding what to learn next,
00:17so it's only natural to wonder just how important responsive design is and whether or not you
00:21need to dedicate the time and energy required to learning it.
00:24Well, the easiest way for me to illustrate this is to simply show you why it's so important.
00:30Every single one of the screens that you see here is able to connect to and display your websites.
00:35And this isn't even half of the screen sizes and resolutions available.
00:41In the past, we've had a pretty good handle on what the target screen resolution for our design should be.
00:46When I first started designing web pages, 640 X 480 was the standard screen size.
00:52From there it went up to 800 X 600, 1,024 X 768, and so on.
00:58To keep pace with the screen sizes, we simply made our designs wider and wider and wider.
01:05It also became standard practice to create designs using fixed widths, meaning that the
01:09website was locked into a specific width regardless of the monitor it's viewed on.
01:14In fact, that's still the standard layout techniques for the majority of sites online.
01:19However, over the last five years we've seen some dramatic changes in how sites are viewed
01:25that are forcing us to reexamine how we design our sites.
01:29Some of those changes were relatively minor, like the aspect ratio of monitors changing
01:34from 4 X 3 to 16 X 9.
01:37Other changes, like the rise of mobile computing, will fundamentally change how we design sites.
01:44Take these screens for example.
01:46Each one of them has a different screen size and resolution.
01:49So which one do you target?
01:51In the past, it might have been pretty easy to say with confidence that the overwhelming
01:56majority of your viewers would use a specific screen size.
01:59That's not the case anymore.
02:01The time and energy required to target each one of these different screens isn't even
02:05worth thinking about.
02:07That's what makes responsive design so important.
02:10Through using the evolving techniques of responsive design, we can create a design that responds
02:15to each of these environments and offers users an experience that conforms to the context
02:20in which it's viewed.
02:21There's a bigger picture here you need to consider as well.
02:24The techniques used in creating responsive designs are continuing to evolve to meet an
02:29even bigger change to web design that's right around the corner.
02:33We've reached the point where adding wireless connectivity to devices is now cheaper than leaving it out.
02:40That means that we're about to experience an explosion of devices that can connect to your content.
02:44Already, we're seeing cars, watches, shoes, and other devices with Internet capabilities.
02:51So while these devices might represent the current ecosystem we need to design for, they're
02:55really just the tip of the iceberg.
02:58To me, that simply underscores how important responsive design is.
03:03Unless we focus on ways to make our content and designs more adaptive across multiple
03:08environments, we're going to be restricted to making sites that work part of the time
03:12for only part of our audience.
03:14So while responsive design might be seen as a new way to approach designing sites right
03:19now, I believe in a few years it will simply be "the way" we design.
03:23
Collapse this transcript
What makes sites responsive?
00:00As with all web design, a responsive design starts with HTML.
00:04Clean, well-structured HTML helps create content that is meaningful and easier to manipulate based on context.
00:12Likewise, the care the designer gives when planning the site's semantics in uses of ID
00:18and class attributes can go a long way towards making the site more responsive.
00:23Clear roles for elements and consistent structure make it easier to control how content responds
00:29or displays within a specific design.
00:32HTML5 also includes a few features that helps sites be more functional across multiple devices.
00:38The new form elements, for example, allow designers to create forms that take advantage
00:43of mobile device interfaces and facilitate making phone calls and sending texts without
00:48requiring extra markup or scripting.
00:51As you would imagine, CSS plays a major role in creating responsive design.
00:56CSS media queries allow us to apply different sets of styles based on factors such as screen
01:02size, orientation, or resolution.
01:05This allows us to change layout and typography to a design that's more suited to the context
01:11in which it's viewed.
01:13Responsive layouts are typically fluid in nature so that they can flex to fit the screen
01:17on which they're viewed.
01:19Newer CSS features, such as transitions and transforms, allow designers to change how content
01:25displays and interacts with the user without requiring additional scripting.
01:30CSS-based graphics can also help reduce the amount of resources requested by the page
01:35by replacing icons or other images.
01:38JavaScript is also used in varying degrees by different responsive designs.
01:43It's primarily used to control resource loading, supply the correct images and media based
01:48on the needs of different devices, and to add device-specific functionality like geolocation
01:53and touch events to sites.
01:56Essentially, these three technologies--HTML, CSS, and JavaScript--form the backbone of
02:03most responsive designs.
02:05Later in this title, we'll explore some of those techniques in a little bit more detail.
02:09For the moment, just remember that it's the concept and goals of responsive design that's
02:14important to understand.
02:15In many cases, there are multiple techniques to help content become responsive, and in all
02:21cases, the techniques and strategies behind responsive design are continuing to evolve.
02:27That means that as a designer, you should explore multiple techniques, experiment with
02:31your own, and think about how responsive design fits in your overall site strategy.
02:36
Collapse this transcript
Exploring a responsive site
00:00Before we move on to talking about specific techniques and strategies, I want to take
00:04a moment to explore a responsive site in action so that you can see how these concepts are executed.
00:11To do that, I'm going to show you the demo created by the very talented Brad Frost for
00:16his HTML5 Rocks tutorial.
00:19You can check out this demo and the corresponding tutorial at html5rocks.com.
00:24Now, first, I want to show you the page on a laptop.
00:28Here we can see the desktop version of the page, which represents a product detail page
00:33from a fictitious apparel company.
00:35One of the first things that people usually do when they show off a responsive design
00:39is to resize the screen.
00:42As you can see, the layout reflows to reflect the size of the viewport.
00:46While visually impressive, it really doesn't represent how your audience will experience your site,
00:52so I want to explore the same page with several different devices and find out exactly what
00:57makes this site responsive, and how the site's responsiveness impacts how people experience
01:04and use the site across different devices.
01:07Before we get in to other devices, let's stay here for a moment and take a look at what
01:11we see on a desktop.
01:13The layout is centered on the page, and it's designed so that it fits within a wide range
01:18of desktop resolutions.
01:20There is a small menu at the top of the page along with a search field.
01:26Below that, you'll find the product detail, and in this case that's three photos that
01:30you can click to get different views of the shirt.
01:34To the right of that we have some additional information about the shirt and the ability
01:38to add it to our cart.
01:40Below that, you'll see a list of similar shirts and customer reviews.
01:44At the very bottom of the page, you'll find a mirror of the top navigation, links to company
01:50information, and the customer service phone number.
01:54So, now let's examine the same page on a tablet.
01:58For the most part, the layout is exactly the same except that the thumbnails are now below
02:03the main product image rather than to the side.
02:06However, if I change the orientation, notice that the layout changes as well to respond
02:12to the additional width.
02:14Now, some of the changes are not that obvious.
02:18Note that the site now realizes it's being viewed on a touch device and allows me to
02:22swipe through the gallery images.
02:25When we move to a smartphone, you can see the layout changes dramatically.
02:31Everything condenses down to a single column and scales so that it fits well within the
02:36smaller space of a mobile viewport.
02:39Right away we can see some changes to the site that are more specific to the mobile space.
02:44First, the top menu is hidden away to save space, but it is available with just a single touch.
02:50Also, note the prominence of the search field.
02:54Within the mobile context, giving users a quick way of searching for content is often
02:58faster and more effective than supporting larger navigational menus.
03:03The photo gallery is still touch-sensitive and you'll notice it responds to finger swipes.
03:07Now, if you look closely, you'll see that there are features built into the site that
03:12are designed to take advantage of mobile devices.
03:16For example, the form for the shirt ordering uses a new HTML5 form element type that is
03:21supported by most mobile devices.
03:24As you can see, when we click into the Quantity field, we are given the numeric keyboard as
03:29a response to the input type.
03:31Now, just below that, you'll find a link for finding a nearby store.
03:36Now, clicking on that is going to take advantage of the phone's location-detection capabilities.
03:42While that feature certainly can work on a desktop computer, users are more likely to
03:46take advantage of that on mobile devices.
03:50Scrolling down we can see that the Similar T-shirts and Reviews are presented in accordion
03:55sections, which is a nice way of saving space for mobile screens.
03:59Finally, notice that the phone number is actually using the telephone URL format, which allows
04:05mobile devices to either make calls or add the number to their contact list.
04:10Now, that's just a brief overview of some of the responsive features of this page.
04:15For a more detailed look at what's going on here, and the techniques behind it, check out
04:19Brad's tutorial on HTML5 Rocks, and be sure to check out his blog, at bradfrostweb.com.
04:27There's a lot going on behind the scenes here that you need to explore, but rather than
04:31focus on exactly how Brad built this page to be responsive, I'd rather that right now
04:36you focus on the why.
04:38It's important to note that each time we examine the page we were looking at exactly the same content.
04:44It simply responded to the context in which it's being viewed to create a better user
04:49experience that's tailored to that environment.
04:51Often, we get so caught in the technical aspects of how to build something that we lose sight
04:57of the reasons that we're actually doing it.
05:00As you approach responsive design, make sure that crafting better user experiences is the
05:05driving factor behind each of the decisions that you make.
05:08
Collapse this transcript
2. Common Concepts
Examining the mobile viewport
00:00In this chapter, I'm going to focus on some of the common concepts and techniques of responsive design.
00:06Many of this will focus on how we target and design for mobile devices, and will deal specifically
00:12with making sure that you can control how your content displays on mobile screens.
00:17Perhaps the most confusing aspect of mobile displays is the concept of the mobile viewport.
00:23Take this iPhone, for example--and I'm going a little old school here and using the iPhone 3GS.
00:30The screen resolution for this phone is 320 X 480 pixels,
00:35meaning that the screen is 320 pixels wide when in portrait mode.
00:39However, notice that when I browse to a site that hasn't been optimized for mobile screens,
00:44like apple.com for example, the entire site is scaled to fit itself into the 320 pixels'
00:51worth of space, even though it was design for a much wider screen resolution--in
00:56this case 980 pixels.
01:00To read a site like this, the user needs to zoom up and then pan to the areas of the page
01:06that they want to read.
01:08So what's going on here, and why is this the default approach for most mobile devices?
01:14To understand that, we first have to understand what the mobile viewport is and how it relates
01:18to the mobile screen.
01:21When we're browsing on a desktop device, the concept of the viewport becomes a little more
01:25obvious, as any open browser window is defined as the viewport.
01:30Because the viewport is independent of the screen, we can resize it to whatever size we want.
01:37On mobile devices, the viewport functions in much the same way.
01:41It gives you a defined area to display web pages that is independent of the device's screen.
01:47It's simply not as obvious as the desktop viewport, and users don't actually resize the
01:53viewport as much as they scale it up or down when they zoom in and out of web pages.
01:58Since viewports have a minimum scaling factor, users rarely ever see their edges as they
02:03do when they resize floating browser windows.
02:07Because of the small size of mobile screens, mobile viewports are designed to be larger
02:12than the screen's resolution.
02:14Mobile Safari has a viewport of 980 pixels, while Opera's is around 850.
02:21When you compare that to an iPhone with a screen width of 320 pixels, you can see that
02:27the viewport is much larger than the actual screen itself.
02:31In large part, this is due to mobile viewports having to display content that's designed
02:36for much wider screens.
02:39Typically, mobile browsers will display a web page within the viewport and then shrink
02:44that viewport down until the content fits within the width of the screen itself.
02:49While this usually results in tiny pages, it does allow the user to see the page in
02:54its entirety and decide which areas of the page they'd like to zoom up to, and read.
02:59If mobile browsers didn't behave this way, you'd only be able to see a small portion of most web pages.
03:05This would be much more confusing as you'd have to pan around the page to explore its
03:09content without really knowing where anything was.
03:13This has been described as keyhole browsing, as it's similar to viewing an entire room
03:17through a small keyhole.
03:18So, while the default viewport scaling is helpful for users browsing sites designed
03:23for larger screens, it can make it extremely frustrating when browsing pages that are designed
03:28specifically for mobile screen sizes.
03:32Let's say that you've created a responsive design that has a mobile phone layout designed for 320 pixels.
03:38On an iPhone, the default mobile viewport is 980 pixels, so your 320-pixel layout is
03:44only going to occupy about a third of that.
03:47The viewport will then be scaled down to fit the 320-pixel screen, making your layout really
03:53tiny and defeating your carefully crafted 320-pixel layout.
03:59So, in order to build responsive sites that fit neatly within mobile screen sizes, you'll
04:04need to know how to control both the viewport size and its initial scale factor.
04:10We'll learn how to do that in our next movie.
04:12
Collapse this transcript
Controlling viewports
00:00Now that we've defined exactly what the mobile viewport is, we need to discuss how to control them.
00:07Currently, there are two mechanisms for overriding the user agent's default viewport.
00:12You can either use the viewport meta tag or the @viewport CSS rule.
00:17Since they both use similar syntax, I'm going to show you code examples for each, and then
00:22describe their effects on the viewport.
00:25The meta viewport tag appears in the head of your HTML, and has two basic parts: name,
00:31which is viewport, and content, which will contain the properties and values you wish
00:36to set for the viewport itself.
00:38The @viewport rule can appear anywhere in your CSS that you want, but since it can affect
00:44media queries, it's recommended that you place it prior to any media queries in your styles.
00:50Most designers place it near the top of their styles as one of, if not the very first, rule.
00:55The syntax is similar to the meta viewport tag.
00:58You simply declare an @viewport rule and then populate it with the properties that you wish to control.
01:05Now that we have the basics of the syntax down, let's examine the individual properties
01:09that you can control.
01:11As we set viewport properties, we'll examine the site optimized for mobile screen sizes
01:15to see how the mobile browser reacts to changes to its default viewport.
01:20First, I want to explore controlling viewport width, which is arguably the most important
01:25viewport property to responsive design.
01:28As you can see, our layout is scaled down dramatically, due to the default viewport settings.
01:34And if we change our viewport syntax to set the desired width to 320 pixels, you can see
01:41the site now displays at the desired width.
01:45Note that in the viewport meta tag syntax, you don't append PX to the pixel value, while
01:51in the @viewport CSS syntax you do.
01:55While a specific pixel value for width might be fine for some projects, remember that not
02:00all mobile screens are 320 pixels wide.
02:04If your website is using a fluid layout, you're going to want the layout to be based on the
02:08available screen width of the device and not limit the viewport to just one single size.
02:14To do that, we can use the property value device width.
02:19This value instructs the browser to set the viewport to the exact size as the available screen pixels.
02:26Setting this will remove any initial viewport scaling and allows you to create fluid layouts
02:31that adapt to multiple devices.
02:33Unless there's a reason to use a specific value for your viewports, this is the value
02:38I recommend you use for your responsive designs.
02:42Just as you can set width, you can also set the height of the viewport, to either a specific
02:46value or by using the value device height.
02:50You probably won't need a control viewport height all that often, but you should know
02:54that the capability exists if you need it.
02:57You can also set the initial scale value for the property's content as well.
03:02It's easy to get this property confused with viewport width, so let's talk about exactly what it does.
03:08Initial scale controls the zoom factor of your content for the initial view of the page.
03:15Once the page has been viewed, the user is then free to scale the page at any factor they want.
03:20Now, it's important to note that this is independent of the viewport width.
03:25So if the initial scale is set to 2, for example, notice that our content is now scaled
03:31up to 200%, even though the width of the viewport remains unchanged.
03:38Setting the initial scale to 1 ensures that the content appears at 100%, regardless of
03:43the viewport width.
03:45It's quite common to see people set width to device width and then also set initial
03:50scale to 1, but in reality that's not really necessary.
03:54If you set the viewport width to the device width, the browser automatically sets initial scale to 100%.
03:59In fact, on iOS devices, there's a bug with initial scale that affects pages when the
04:05orientation changes,
04:07so many people advise leaving initial scale off entirely unless you need to set the value
04:12to something other than 100%.
04:14In terms of syntax, notice that you use an integer to set the scaling factor and that
04:19meta viewport tags use the initial scale property, while @viewport uses zoom.
04:25The @viewport syntax currently also allows a percentage value as well, but since that
04:30may change in the future, you're safer just using a number.
04:34You can also control the range of scaling allowed by your site as well.
04:38Let's say you want to allow people to zoom in and out on your page content, but you do
04:42want to control just how much zooming they can do.
04:46By using the minimum and maximum scale properties, you can do just that.
04:49Now, in this example I've set it up so that the minimum scaling is 1 and the maximum scaling is 2.
04:57Notice that the user can scale up to 200% but can't scale down pass 100%.
05:04In terms of syntax, there is a little bit of difference between the meta viewport tag
05:08and the @viewport syntax.
05:10In the meta viewport tag, you'll use the minimum and maximum scale properties and a positive
05:15numeric value, which indicates the scaling factor.
05:19In the @viewport syntax, you'll use the minimum and maximum zoom properties, and can use either
05:24a positive number or a percentage value.
05:27If you wish, you can turn scaling off entirely by using the user-scalable property.
05:32This allows you to either enable or disable user's ability to zoom in and out on your
05:37page content, and is more commonly used actually for applications than websites.
05:42For the meta tag syntax, you'll use user- scalable and values of either yes or no, and for
05:48@viewport, you'll use the user-zoom property which will accept either the zoom or fixed values.
05:56Keep in mind that users are accustomed to having the ability to zoom in and out of web content.
06:01If you disable this for your site, you should have a clear and compelling reason to do so.
06:06These are just a few of the properties you can control when overriding a browser's default viewport.
06:11For a complete list of properties and for more information on the syntax, visit the
06:16Safari HTML Reference page for the viewport meta tag syntax or the CSS device adaptation
06:23specification for more information on the @viewport rule.
06:26Now, it's important to note that support for the meta viewport tag is almost universal,
06:32while the @viewport syntax is still relatively new and largely unsupported for now.
06:37Existing support for the @viewport rule is also largely restricted to using vendor prefixes,
06:42so you'll need to be mindful of that if you choose to use that syntax.
06:46Adoption of @viewport is happening fairly rapidly, and the specification is maturing,
06:51so I expect we'll see full support for it in the very near future.
06:55Once this happens, we'll be able to choose exactly how we want to control user agent's
06:59viewports when creating responsive designs.
07:02
Collapse this transcript
Understanding screen densities
00:00In addition to the increased diversity of screen sizes, you'll also need to deal with
00:04the growing issue of screen densities.
00:08Screen density is the number of pixels within a physical area of a screen,
00:12and newer screens are featuring higher and higher screen densities every year.
00:18Take these two iPhones for example.
00:20This one is the older 3G model, while this is the newer 4S.
00:25The 3G has a screen resolution of 320 pixels x 480 pixels, while the 4S has a resolution
00:34of 640 pixels x 960 pixels.
00:38Now, they both have the same size screen, at 3.5 inches,
00:42so in order to have a higher resolution, the 4S has to have a greater number of pixels.
00:49Now, that sounds pretty straightforward, but it actually causes a number of issues
00:54that you have to understand when designing for higher-density screens.
00:59The first issue is properly defining what exactly a pixel is when you're dealing with
01:04higher-density screens.
01:05Now, if you've been designing for any time at all, you probably think you've got a pretty
01:09good handle of what exactly a pixel is, but for screen density, we actually need to focus
01:15on two types of pixels: hardware pixels and reference pixels.
01:21Hardware pixels are pretty straightforward.
01:24Let's zoom in on an older lower-density screen.
01:27Here you can see the individual pixels themselves.
01:31These are hardware pixels, and they represent the smallest points the screen can display.
01:36If we look at the same cross-section of a higher-density screen, you can see that in
01:41this example the number of hardware pixels are doubled, allowing the screen to display
01:46finer detail within the same dimensions.
01:49However, this increase causes unintended side effects.
01:53Let's say you had a line of text that was 30 pixels high on a lower-density screen.
01:59The same text mapped to the higher- density screen would now appear twice as small.
02:05That means without accounting for this difference, graphics and websites would appear dramatically
02:10smaller on newer higher-density displays.
02:14That's where reference pixels come in.
02:16A reference pixel, sometimes referred to as a CSS pixel, is a unit of measurement that
02:22establishes an optical standard for the length of a pixel and is totally independent of hardware pixels.
02:29In the W3 standard for CSS, this unit is described as roughly 196th of an inch, depending on the
02:36ideal distance from the viewer.
02:39Although the definition may vary from platform to platform, the concept is the same.
02:43The reference pixel gives you a way to consistently set the size of elements that is independent
02:49from the actual screen density.
02:52Okay, so let's go back to our pixel example.
02:54If you've specified that an element be 50 pixels wide, it might map to the first screen
03:00at exactly 50 pixels if the hardware and reference pixels were the same.
03:06On a higher-density screen, however, the device would actually display the same element over
03:11100 hardware pixels to ensure that it remains the same visual size.
03:17It does this by applying a scaling factor to the page elements.
03:21This scaling factor is often referred to as device-pixel-ratio--that is, the ratio between
03:28reference pixels and hardware pixels.
03:31Knowing the proper ratio is crucial for targeting and properly preparing graphics for higher-density screens.
03:38To see how this is taking shape across manufacturers, let's take a moment to look at the Mobile
03:43Matrices page created by the nice people over at the mobile-boilerplate.
03:48Here we can see the listing of several mobile devices and their screen size, resolution, and screen density.
03:55If we compare the older iPhone and iPads to the newer ones, we can see that the screen
03:59densities are exactly double, which means the device-pixel-ratio for the new Retina displays is 2.
04:05When we take a look at Android devices, however, the ratios get a bit more complicated.
04:11There are so many manufacturers working with different screen densities that you can't
04:16assume a specific device-pixel-ratio for targeting higher-density screens.
04:21In fact, Android uses four basic device-pixel ratios. These are low density, or .75 for screens
04:30lower than 120 pixels; medium density, which is considered the baseline at 1 for screens
04:36up to 160 pixels; high density at 1.5, for screens up to 240 pixels; and then extra high
04:42density at 2, for screens up to 320 pixels.
04:48Higher screen densities aren't just limited to mobile devices either.
04:51Apple recently introduced a new MacBook Pro that has a screen density of 220 pixels, which
04:58is twice its other models, giving it a pixel-density-ratio of 2 as well.
05:03Okay, so now we know what screen density is and how hardware pixels relate it to reference
05:08pixels, but what does it mean to you in the real world?
05:12Well, in many cases, you won't need to do anything at all.
05:16For text in CSS-generated graphics, the device will handle the scaling itself and use the
05:21extra hardware pixels to make everything look clearer and sharper.
05:24For images, however, it can be a bit of an issue.
05:28Take a look at these two screens.
05:30On the left, you'll see an older iPad and on the right, a newer model with a Retina display.
05:37Although the top image doesn't look too bad on either of them, the Retina display does
05:41look a little blurry.
05:43Notice that when I scale up on the Retina display, you can clearly see the degradation of image quality.
05:49The scaling factors involved in higher-density screens can often actually harm image quality
05:54as they are scaling images up by default.
05:57If I compare it to the bottom image, which is a higher-resolution version of the first
06:02graphic, you can see that there's a clear difference in image quality.
06:06When building responsive sites, you'll need to decide whether or not you also want to
06:10supply larger images for higher-density screens.
06:13The methods behind doing this, and the factors that you need to consider when making those
06:17decisions, are considerable, so we'll tackle them next.
06:20
Collapse this transcript
Designing for multiple screen densities
00:00Now that we've discussed what screen densities are and the issues surrounding higher-resolutions
00:05screens, let's talk about ways we can optimize graphics for higher-density displays.
00:11One of the first things you can do is to simply consider minimizing the amount of bitmapped graphics you use.
00:17If you use vector image formats like SVG, or use CSS in place of simple graphics, many
00:23of the issues with scaling factors will go away.
00:27Vector graphics are resolution-independent and scale without any loss of image quality.
00:32Likewise, CSS-based graphics for simple icons and buttons will scale to any size and maintain
00:38the same sharpness and clarity.
00:40Even on lower-density mobile screens, scaling is a way of life.
00:44It's very common for users to zoom in on page regions, so it's a good idea to try to make
00:48your content as scalable as you can.
00:51Of course, these approaches are not without their drawbacks.
00:54SVG images can be considerably larger than their bitmap counterparts, and vector graphics
00:59are redrawn with each pan and zoom.
01:02Both of those issues can impact performance considerably.
01:06Likewise, drawing with CSS can be effective, but you need to be aware of its limitations.
01:12Complex artwork is often out of the range of its capabilities, and often non-semantic
01:16markup is required to achieve the desired results. Support for CSS properties like CSS
01:22transform aren't uniform yet either,
01:24so make sure that any graphics created with CSS uses properties that are well supported.
01:30You can also use icon fonts.
01:33Icon fonts are fonts populated with, you guessed it, icons.
01:37This for example, is Modern Pictograms, which is available here at fontsquirrel.com.
01:42The great thing about these icons is that they are easy to size and they scale automatically
01:47with your site's text.
01:49Unless you use generated content, however, you have to include unnecessary characters
01:54in your markup, which could be confusing from an accessibility standpoint.
01:59Regardless, there will be times when raster graphics are the appropriate choice.
02:04For raster graphics, you have a few options when targeting high-density screens.
02:08The basic idea is this: if you need an image to be 100 pixels x 100 pixels, you simply
02:14create the image at the scaling factor that's appropriate for the targeted screen.
02:19For example, an iOS device with a Retina display has a scaling factor of 2, so you'd create
02:25the image at 200 pixels x 200 pixels.
02:28It's important to note here that DPI does not matter;
02:31it's only about the physical amount of pixels.
02:34Now when targeting the high-density screen, you use the high-res image and then resize
02:39it to the desired 100 pixels x 100 pixels size.
02:43Because of the default scaling factor, the additional pixels will map to hardware
02:47pixels, which will give you a much sharper and more detailed image.
02:50While this technique is relatively simple, actually targeting high-density displays can be a bit trickier.
02:57One solution is to simply not target them at all and use high-res graphics wherever
03:02you feel they're appropriate.
03:03Lower-density screens will still display them just fine, and in fact, you'll probably see
03:08improved image quality due to the scaling factors involved with lower-density screens as well.
03:13The downside to this approach is that these higher-resolution graphics are larger in size,
03:19meaning that you are asking for some of your users to download larger images than they really need.
03:24You also have the issue of the scaling factors themselves.
03:27Not every high-density screen uses the same device-pixel ratio,
03:30so you'd have to account for the largest size needed, which again leads to unnecessary file
03:35sizes in most instances.
03:38If you want to target the devices themselves, you have two main options at present.
03:42First, if you are targeting CSS background images, you can use media queries to target
03:48specific device-pixel-ratios.
03:50Then you simply change out the image for the high-res version and use the background size
03:55property to properly size the image.
03:58The issue here is that support for device-pixel- ratio isn't even across platforms, and it currently
04:03requires vendor prefixes.
04:05You're also limited to background images, meaning that context-based images using the
04:10image tag can't be swapped using this technique.
04:13To do that, you'll need JavaScript.
04:16Using JavaScript, you can query a user agent's device-pixel-ratio and then pass a request
04:21to use the higher-res images over the lower-res images.
04:24You have to be careful here, in that you don't want user agents to download unneeded assets,
04:29so writing the script so that it controls resource loading properly is very important.
04:35In the end, you'll need to consider carefully whether using high-res images is appropriate
04:39at all. And perhaps one of the biggest pieces of irony in web history,
04:44mobile devices, which have the most unreliable network connections and data plans that often
04:49charge by the amount of data being used, now feature the highest-resolution screens requiring
04:54the biggest images to take advantage of them.
04:57You need to think carefully about who your users are, the context in which the images
05:02are being used, and whether or not it's appropriate to serve high-resolution images for the site.
05:07Of course, screens continue to evolve, and high-density screens are finding their way
05:12to more than just phones and tablets.
05:14It won't be long before these screens are the dominant displays across all devices.
05:19Because of this, having the ability to properly target screen density and then serve the proper
05:24assets is crucially important to web authors.
05:27There are currently a number of browser developers and standards writers working on this issue right now,
05:32so pay careful attention to how HTML and CSS change to provide this functionality.
05:38One day soon, we'll have syntax in place that allows us to specify which assets to use for
05:43which device and how bandwidth might play a role in that selection.
05:48Currently, however, we'll need to make do the best we can using the techniques that are
05:52available to us now.
05:54That means that as a designer, you'll have to carefully consider all of your options
05:58when designing for multiple screen densities.
06:00
Collapse this transcript
Understanding media queries
00:00Media queries are an important part of responsive design, as they allow you to write styles that
00:05respond to changes in things like screen size or orientation.
00:10They're not really a new feature of CSS, but rather, an extension of the existing media declarations.
00:17Through media declarations, CSS has allowed us to filter style application by media type
00:21for quite some time now.
00:23In the past, we have been able to define which styles apply to screen devices, projectors,
00:27printers, and handheld devices through some pretty basic syntax.
00:32While these capabilities were extremely handy in making sure that you could write separate
00:35style sheets for screen and print, they never really realized their ultimate goal of defining
00:41multiple device types.
00:43Mobile manufacturers for the most part, shunned the handheld media type due to its limited
00:48use and their desire to give users the full web experience.
00:53That left a huge gap, in terms of a designer's ability to write styles that changed based
00:58on the type of device being used.
01:01To fill that gap, media queries were created to allow designers to extend the media declarations
01:06to include various media properties when filtering style application.
01:11This is actually incredibly more useful, as it allows designers to control styling based
01:16on factors such as screen size, orientation, or color, which is far more flexible than
01:21simply defining a device type.
01:24Let's take a quick look at the syntax and how it works.
01:27Media queries contain a media type and one or more expressions.
01:32These expressions contain media features, which are then evaluated and used to determine whether
01:38styles are applied or not.
01:41Keywords such as "and," "not," or "only," help you refine exactly when styles are applied.
01:49Not negates the expressions that follow it and applies the styles only if the conditions
01:54that follow it are not met.
01:57Only can be used to detect for media query support, as older user agents that don't support
02:03them will ignore any media declarations that begin with only.
02:07The and keyword allows you to join expressions together, further filtering when styles will be applied.
02:13You can also comma-separate a list of media queries, which is very much treated like the
02:18or logical operator.
02:20In this case, if one of the expressions returns true, the entire list is applied.
02:26We also have a very diverse group of media features to test for.
02:30We have width, height, device-width, device-height, orientation, aspect-ratio, device-aspect ratio,
02:39color, color index, monochrome, resolution, scan, and grid.
02:46As you can see, some of the features also accept a minimum or a maximum prefix.
02:52This allows much more flexibility, as you can check for a minimum height or a maximum width
02:57instead of a fixed value.
02:59Media queries can also be used in several different places.
03:02Depending upon how you access your styles within your sites, it's helpful to know some
03:06of the variations on media query syntax.
03:09If you're using a link tag to access external styles, this syntax that I've been using here is fine.
03:16If you're creating modular style sheets and using @import to bring in external styles
03:20within style sheets, you'll want to modify @import to include a media query as you see here.
03:26You can also apply media queries within the style sheets themselves.
03:30By using an @media block to surround styles, you can filter how styles within style sheets apply as well.
03:37I also want to mention that if you don't declare a media type, all is assumed.
03:42So if you're filtering results to apply to all media types, you can simply exclude the
03:46media type and the remainder of the syntax will still work just fine.
03:51To learn more about media query syntax, be sure to check out the media queries specification on the W3C site.
03:58As you see here, you can go to w3.org/TR/css3-mediaqueries.
04:07So, when can you actually start using media queries?
04:09Well, right away, especially if you are working on mobile devices.
04:13Most modern browsers and mobile platforms support media queries, and using scripts such
04:19as Scott Jehl's Respond.js can help add support for older versions of Internet Explorer. Okay.
04:27So now that you know a little bit about media queries and what they can do for you, it's
04:31important to see how they work when building responsive designs.
04:34We will tackle that in our next movie.
04:36
Collapse this transcript
Creating breakpoints with media queries
00:00Now that we know a little bit more about media queries, we need to take a closer look at
00:05how they're implemented in a responsive design workflow.
00:08We'll start by exploring the concept of a breakpoint.
00:12A breakpoint indicates the moment your layout switches from one layout to another, and is
00:17usually triggered by the width of a screen. Take this example.
00:21When I resize the screen, you can see the containing block changes both size and color
00:27when the viewport reaches a certain size.
00:29The screen sizes are based on the typical screen sizes for smartphones, tablets, and desktop devices.
00:37While many layouts will have more than these three basic breakpoints, almost all responsive
00:41designs will feature some combination of those three screen size ranges.
00:47This means that one of the first things that you need to do when planning a responsive
00:50design is define the breakpoints for your layout.
00:54Here you see a list of three of the most common breakpoints.
00:58Mobile styles will target any screen smaller than 480 pixels wide, while tablet styles
01:04will usually target screens between 481 and 768 pixels.
01:09Desktop styles, on the other hand, will target any screen wider than 768 pixels.
01:15Obviously, all tablets and smartphones aren't the same size, so you'll need to determine
01:20which range of screen widths you will want to support.
01:23Those measurements are widely used and are a great way to start.
01:27Once you have your breakpoints, you'll need to then define your media queries to filter
01:31style application based on your target sizes.
01:35Here you see three media queries that target our sample breakpoints.
01:39Although there are variations on the syntax you can use, I want to walk through the syntax
01:43that's being used here to explain how breakpoints are being set.
01:47Note that each of the media queries uses the only keyword, which hide the styles from older
01:53non-conforming user agents.
01:55Because of this, you will want to have a set of default styles to fall back on.
02:00The screen media types ensure that the styles apply to screen-based devices.
02:05The mobile media query uses the maximum-width media property to restrict styles to screens
02:10under 481 pixels, which should target the majority of smartphone devices.
02:16The tablet media query uses slightly longer syntax, by combining both a minimum and a maximum-width
02:22media property to define a specific range of screen sizes.
02:27Essentially, this targets any screens between 481 to 768 pixels.
02:33Note that the minimum-width value is one pixel over the smartphone query.
02:37You want to make sure there is no overlap as you plan your breakpoints which could cause
02:42some cascading issues within your styles.
02:44Finally, the desktop media query simply targets any screen size over 768 pixels.
02:51Notice that all three of these media queries are using the width property with a minimum
02:56or a maximum prefix.
02:58Although device-width is also an option, width is slightly more flexible.
03:03Device-width is equal to the available pixels on the device itself, whereas width simply
03:09refers to the width of the viewport.
03:11This means that any resizing that's done to the viewport will actually trigger media queries
03:16if you're using width.
03:17Plus, there are inconsistencies in how devices report device-width, which makes width a slightly
03:23more stable choice.
03:25You have probably noticed that in each of these media queries, I've got a very simple
03:29CSS rule that changes the background color and some other properties for this paragraph.
03:34Now, to see these in action, all I need to do is resize my browser window.
03:39Each time the width of the screen hits a breakpoint, the background color of the text changes.
03:45If we view this page on a tablet and a smartphone, you can see the appropriate media query is
03:50triggered and the expected properties are applied.
03:52Of course, to create a responsive design, the CSS required for each media query will
03:57be a little bit more complex and usually feature layout styles based on a fluid grid that is
04:02specific for each breakpoint.
04:04I should also point out that there is a growing movement among responsive designers to set
04:09breakpoints using ems instead of pixels.
04:12By using ems, the width of the screen is set relative to the device's font size.
04:16Here for example, we could change this media query from pixels to ems by dividing the width
04:21of 480 pixels by 16 pixels and setting that to the resulting 30 ems.
04:28Since the average device font size is 16 pixels, this is usually a good place to start from.
04:33While this requires us to do a little math on the front end, we now have a responsive
04:37design that responds not only to the screen's width but also user's zooming as well.
04:42While creating breakpoints with media queries is an important part of responsive design,
04:46it's only the first step to creating responsive layouts.
04:49To create a layout that's truly responsive, you'll need to combine these breakpoints with
04:54fluid grids, which we'll discuss next.
04:56
Collapse this transcript
Using fluid grids
00:00One of the most famous observations about responsive design is that it's becoming more
00:05and more important to think of your content like water.
00:09It needs to have the ability to flow into whatever container it's viewed on.
00:14If you limit yourself to creating fixed layouts for each of your breakpoints, you're ignoring
00:19the wide variety of screen sizes within each range.
00:22One of the best ways to make sure your content works, regardless of the screens being viewed
00:27on, is to use a fluid layout so that your content can flex and resize within each of
00:33your set breakpoints.
00:35As you can imagine, creating separate fluid layouts for each breakpoint creates considerably
00:40more work than crafting a single fluid layout or separate fixed layouts.
00:46For this reason, many designers have adopted the use of fluid grids to make crafting multiple
00:50layouts faster and more precise.
00:53Grid systems are a fantastic way of creating structured, properly proportioned layouts
00:58and have been used by designers for decades across multiple disciplines.
01:03For a web design, grids are typically defined as a number of columns and gutters that are
01:08then used by the designer to establish the widths of page elements and regions.
01:13The exact number of columns and their base width is typically up to the designer, and
01:17is usually related to a default font size, ideal ratio, or an ideal screen width.
01:23Many designers will use a 16-pixel-based grid as that's the default font size for most browsers,
01:29or will use a base value that divides into their ideal layout width.
01:35Although the most popular currently is 960 pixels, many designers are moving to grids
01:40based off of larger ideal screen sizes, such as a thousand pixels.
01:44Once the grid is established, page elements are mapped to grid coordinates and values
01:50are assigned based on where they fit within the grid.
01:54To make the grid fluid, you would simply use either relative units of measurement, like
01:58ems, or percentage values for the width of the columns and gutters.
02:03Grid frameworks can be built to use a single grid with enough columns to handle various
02:07screen widths or they could feature multiple sets of fluid grids,
02:11each one optimized around a specific breakpoint.
02:14Typically, in a multiple set framework, the number of columns increases as screen sizes
02:20get wider and the width of the gutters change to maintain spatial relationships at each breakpoint.
02:26Regardless of the approach taken in constructing the grid system, it's usually built with an
02:30array of classes that define the number of columns that an element should span, any floating
02:35or positioning requirements, and the desired padding in margin values.
02:40Additional classes are used to clear floats, define containing elements, and handle any
02:45additional layout requirements.
02:47Once the framework is built, creating the actual layout becomes fairly simple: based on the
02:52desired layout, you simply add the appropriate classes to the appropriate page element.
02:57As you could imagine, building this type of grid framework requires a lot of work.
03:01I'm sure by now you've probably wondered if all that work is really necessary.
03:05Well, remember that each project is different, and you can certainly do this by degrees.
03:10If you're design is relatively simple and unlikely to change frequently, it might be
03:14more efficient to simply create layouts for each breakpoint that's tailored for specific screen ranges.
03:20If your layouts are more complex or have a wide range of variations in terms of page
03:24types, it's probably worth it to take the time to craft a framework around your site's specific needs.
03:30Once the framework is built, it dramatically speeds up development time and makes it extremely
03:35easy to test and prototype layout variations.
03:39Perhaps the best thing about building this type of framework is that you can use it again and again.
03:43Once built, creating flexible page layouts across multiple screen sizes becomes much, much simpler.
03:50If you simply don't have the time to construct your own fluid grid system or feel that
03:54your technical skills aren't quite at that level yet, I'm happy to tell you that there
03:57are a multitude of existing frameworks that you can download and use within your own projects.
04:02These frameworks range from the very simple layout-only styles to entire boilerplates
04:07that come with a mixture of HTML, CSS, and JavaScript that provide a full framework for site development.
04:14Which framework is right for you is largely a personal decision and likely to be impacted
04:18heavily by the goals of individual projects.
04:20The good news is you have a lot of options to choose from.
04:23Of course, there are some downsides to using fluid grids.
04:27The styles are heavily class-based and usually use non-semantic class names that can clutter up your HTML.
04:34Some require specific containing and clearing elements that may force you to include additional
04:38markup to your HTML as well.
04:41Most of these frameworks are fairly large in size, too.
04:44Since it's doubtful that you'll ever use every layout option a grid framework might contain,
04:48you could be including a significant amount of code in your projects that you don't really need.
04:54Whether you use an existing framework or build your own, it's certainly worth your time to
04:57download and explore a few of them, just to see how different developers have approached
05:01building fluid grids.
05:04If you're new to CSS and need more information on the basics of building fluid layouts, be
05:08sure to check out my CSS: Page Layouts title in the lynda.com online training library.
05:14
Collapse this transcript
Making images responsive
00:00Using fluid layouts ensures that as screen sizes or orientations change, content will
00:06reflow, or reconfigure along with it.
00:09That works seamlessly for contents such as text which naturally reflows along with its
00:14containing element,
00:15but what about content that is by default defined at a fixed size, such as images or other media?
00:22An image designed for a large desktop monitor is unlikely to fit into a layout designed
00:27for a 320-pixel-wide smartphone.
00:30Likewise, images designed to accompany content on a mobile screen would probably look like
00:35thumbnails when viewed within desktop layouts.
00:39This means that in the best of circumstances, these images will look out of context and
00:43in many cases, will break your carefully crafted responsive layouts.
00:48This problem underscores how important it is to find ways to make images and other media responsive.
00:54At first glance, you'd probably be tempted to say the solution is pretty simple: just
00:59replace the fixed dimensions with relative measurements or percentages and then boom,
01:04flexible responsive images.
01:06Well, unfortunately, it's just not that simple.
01:09Matt Wilcox recently called the issue surprisingly complex, and I'm inclined to agree with him.
01:16Currently, if you want to make images responsive, you do have a couple of options.
01:20First, you could simply do what we discussed earlier: replace the fixed dimensions with
01:25percentages or relative units.
01:27You can even add a maximum-width property to avoid scaling the image past its original size.
01:33To make the math of calculating image proportions a bit easier, you could also place the image
01:38in a flexible container and simply use a max-width equals 100% property to constrain the image
01:45to the size of its container.
01:48Since this works with any element, you could use this with other fixed media assets such
01:52as Flash or video as well.
01:54Well, that sounds easy enough and it seems to work, so what are some of the issues with this technique?
02:00Well, Internet Explorer doesn't support maximum-width,
02:03meaning you'll have to use a workaround to achieve the same effect.
02:06Also, you have to be careful when mixing width and maximum-width properties.
02:11The width property explicitly sets the width of the element, while maximum-width tells
02:16the element not to exceed a specific width.
02:19Those are not the same thing.
02:22Perhaps the biggest issue with this technique is one of size.
02:26Since you never want to scale images up and damage the image quality, you'll need to supply
02:30the largest image size that your layouts might require.
02:34This means that you'll be asking mobile devices to download larger images than they need and
02:38then scale the images within the browser.
02:41Both of these actions will harm performance on mobile devices and are less than ideal.
02:45If the image is purely decorative and not really necessary to the structure of the page,
02:50you could serve the image as a background image.
02:53By doing that, you could place requests for separate background images in each media query,
02:59ensuring that you're requesting only the image that you need for the proper device.
03:04This allows you to not only control the image's size, but also the image's context.
03:09If you're scaling an image down with a lot of detail, for example, that detail will often
03:13get lost as the image gets smaller.
03:16By serving a separate image for smaller layouts, you can crop the image or modify it to convey
03:22the right visuals for the appropriate space.
03:24In many cases, this solution works great, but it's not without its problems either.
03:30It's limited in that it can only work for images that don't need to be in the actual HTML.
03:36For images where accessibility is required or that fit within the context of the HTML,
03:41this technique won't work.
03:43It's also worth noting that in earlier versions of Android, all of the CSS background images
03:48would be downloaded, not just the ones needed for the appropriate media query.
03:52Now, this has since been fixed in Android, but it will create large resource downloads
03:57for users on older Android devices.
04:00If you're looking for some more robust options, there are a few solutions that have been created
04:04to utilize JavaScript or server-side scripting to examine the page, determine the context,
04:10and then serve the appropriate image.
04:13The Filament Group has a fantastic client- side solution that they dubbed Responsive-Images,
04:18and you can check that out at their GitHub repository.
04:21Essentially, you just modify your .htaccess file, link to their responsive images JavaScript
04:27file, and add a query string on any image that requires a larger desktop version of that image.
04:33The script will then parse the page and replace the smaller images with the larger ones when
04:38they're appropriate.
04:40There are many solutions like this one that have been developed over the last couple of
04:43years, and most of them share this basic approach:
04:46have script determine the context, then parse the page and serve the appropriate image.
04:52As with our other techniques, these solutions have their share of problems as well.
04:56First, they're a little bit more complex than a pure HTML or CSS solution.
05:02The JavaScript parsing can slow load times, and often replacement images are requested
05:07after the original image is already downloaded.
05:10That brings us to perhaps the biggest downfall of these types of techniques, and that's the
05:14evolution of browser prefetching.
05:17In an attempt to speed up page loads, browsers have begun to employ look-ahead prefetchers
05:22to request and download page assets before the HTML has finished loading.
05:29This means that any technique that attempts to parse the page and replace assets will
05:34be replacing assets that, to some degree, have already been downloaded.
05:38Essentially, all this means that while we do have some choices currently in making our
05:42images work within responsive designs, the current solutions are far from perfect.
05:48In our next movie, I want to delve further into the problems behind responsive images
05:52and a few of the solutions that are on the horizon that you'll need to keep an eye on.
05:56
Collapse this transcript
Examining the future of responsive images
00:00In the previous movie, we talked about some of the current responsive image techniques
00:05and why they are not entirely ideal solutions.
00:07To gain a better understanding of why these techniques fall short, it's helpful to list
00:11out all of the things we need to be able to do in regard to responsive images.
00:17To truly have responsive images, we need to have the ability to choose which image is
00:21served to which device.
00:23It's not enough to simply have an image that scales down for smaller screens; rather, we
00:28need to have the ability to make sure the right image is served to the right context.
00:33Currently, that's largely determined by three factors: screen size, screen density, and bandwidth.
00:40A screen that is 320 pixels wide is obviously going to need a different set of images than
00:45one that is, say, 1440 pixels wide.
00:49Likewise, higher-density screens can display much higher resolution images so it would
00:54be nice to be able to serve high-res graphics to displays they can take advantage of them.
00:59In regards to latency and bandwidth, obviously a larger image would be more of a burden over
01:05slower connections, so it would also be nice if we could substitute smaller low-res graphics
01:11for those instances.
01:12Unfortunately, when you look at these three criteria side by side, it's obvious that in
01:18many cases you're going to have competing factors.
01:21For example, in many cases mobile devices are going to have lower bandwidth connections
01:25or a higher degree of latency;
01:27however, those devices are currently more likely to have high-density screens than desktops.
01:33To make matters worse, we need to establish these factors and choose the proper image
01:38before the request for page assets are made.
01:41Since browsers are constantly looking for ways to speed up page loading, techniques like
01:45pre-fetching, which begins to download resources before the HTML is fully loaded, are going
01:51to make enabling responsive images that much harder.
01:55In fact, there are so many variables that go in to establishing the proper image context
02:01that the best solution is likely to be one in which we give the user agent a number of
02:06images to choose from and let it select the proper one based on its current profile.
02:12Thankfully, the browser development community and the groups responsible for writing the
02:16HTML and CSS specifications are aware of the problem and how hard at work to solve it.
02:22I want to discuss a few of the solutions that have been proposed that you need to keep an eye on.
02:27As solutions begin to be implemented, you should be prepared to start experimenting
02:31with them in your own workflow.
02:33Recently, the WHTWQ, the organization behind the HTML5 specification, proposed a modification
02:39to the existing image element.
02:41They proposed adding a new attribute called srcset.
02:45The proposed syntax would allow authors to provide a comma-separated list of images and
02:50related property such as viewport width, height, and pixel density, that the user agent could
02:56then use to determine which image to use.
02:59The nice thing about this syntax is that it's fairly straightforward and uncluttered,
03:03it doesn't require any new HTML elements, and it's backward-compatible.
03:08User agents that don't understand srcset will simply use the default source attributes image.
03:14A competing proposal by the w3c's Responsive Images community group is the picture element.
03:21Picture would be a new HTML element modeled after the HTML5 video element.
03:26As you can see from the syntax, the picture element acts as a parent for a range of source
03:31elements and an image element.
03:34Each source option can contain alternate images, image properties, and optional media queries
03:40for further filtering refinement.
03:42You may have picked up on the fact that this example has srcset as one of its source attributes.
03:47Now, this is a result of an attempted compromise between the WHTWG's srcset proposal and
03:53the working groups picture proposal. The user agent would choose from either the source
03:57image that matches the current conditions or use the default image tag.
04:01Now, both picture and scrset have their share of problems and currently, there is a very
04:07vigorous debate going on among implementers as to what the best approach of these two choices would be.
04:13Since the syntax of both options continues to change rapidly, my guess is that we'll
04:18see a hybrid version of both, or maybe even totally different solution that approaches
04:23the problem from a different angle.
04:25Other proposed solutions have included enhanced meta tags or modifying http headers to contain
04:31bandwidth and viewport dimensions.
04:34To me, the issues surrounding responsive images illustrate the fact that responsive design
04:39is a totally new approach to designing websites.
04:42And many aspects of it are still evolving.
04:45As such, as a designer, you're going to need to pay careful attention that how techniques
04:49change and how implementations are carried out so that you're prepared to adopt them
04:54as they mature.
04:55
Collapse this transcript
Building responsive forms
00:00Responsive design isn't just about modifying layouts to fit screen sizes.
00:05To build truly responsive sites, you need to think about the context in which the site
00:09is being used and then try to tailor the user experience to best suit that environment.
00:15That's especially true for site features such as forms.
00:19Making sure your forms are clear and easy to fill out is an important part of any good user experience.
00:26Since form factors change from one device to another, it can be challenging to build
00:30forms that are equally effective across devices.
00:34With that in mind, I want to go over a few practices and techniques that you can use
00:38to help make your forms more responsive.
00:42As you might expect, you need to start the process of building responsive forms during
00:47the initial planning stages.
00:49My recommendation is that you start by considering the mobile context first.
00:56Good mobile forms have reduced clutter and focused form elements.
01:00By thinking about how to build more streamlined form that still captures what you need, you'll
01:05eliminate extraneous form controls and build a better overall user experience.
01:11In fact, most of the recommendations that I'm going to give here are centered on forms
01:16and mobile devices.
01:17That's because within the mobile context there are usability considerations that users don't
01:22really run into on desktop devices.
01:25By keeping those considerations at the forefront as you plan, you'll create better overall
01:31forms and make it easier to adapt your forms to mobile devices.
01:36It probably goes without saying, but make sure that you're structuring your forms so that
01:40you can build responsive form layouts.
01:43And for some reason, form layout is the one aspect of page layout where tables just refuse
01:48to die. Eliminate extraneous markup on your forms and use structural elements like lists
01:55and field sets to properly mark up form structure.
01:59This will make your forms cleaner in terms of markup and easier to style with responsive layouts.
02:05In terms of layout, think about how form designs should change from one screen width to another.
02:11It's perfectly acceptable to have labels beside form elements for wider screens, but as the
02:16screen sizes become smaller, you need to start putting the labels on top of the input elements
02:21to save screen real estate and make your forms easier to read.
02:26Make sure the color choices that you make and how you organize form sections help guide
02:30mobile users through your forms as well.
02:33Keep in mind that on mobile screens, only a small portion of your form will be visible at any given time.
02:40By keeping this height constraint in mind, you can group form elements in ways that guide
02:44the user throughout the process.
02:47This is especially important for longer forms.
02:50Also, remember that smaller screen sizes are primarily touch-enabled, so when laying out
02:55form designs for smaller screens, make sure that the form elements have enough distance
03:00from each other to discourage the user from accidentally focusing on the wrong element.
03:06To that end, it's helpful to wrap input elements with label tags rather than associating labels
03:12with the for attribute.
03:14By wrapping inputs with label tags, both the input element and the label text become responsive
03:20to clicking or touch, giving mobile users a larger target region when activating form elements.
03:27Speaking of form elements, make sure that you're using the newer HTML5 form elements
03:32and attributes when appropriate.
03:35New input types, such as email, URL, and search, not only add more semantic information about
03:41the form element, but robust mobile support for these elements aids user experience by
03:46changing input controls to reflect the input type.
03:51Compare the keyboards displayed when these two form elements are selected.
03:57The first uses the email type, while the second uses URL.
04:03Each supplies the users with common email and web address elements without making users
04:09search for special characters.
04:11Little things like this can go a long way towards building better user experiences.
04:16While it's a common practice on desktop layouts to have descriptive text that guides users
04:20in filling out the form, at smaller sizes, this text becomes an impediment to accessing form elements.
04:27Think about ways you can break this information up or even remove it all together.
04:32One way to reduce the amount of extraneous text is to use placeholder data in your form elements.
04:37This can be a great way to pass on useful information and explain formatting guides
04:41for information such as addresses and phone numbers.
04:45The HTML5 placeholder attribute is widely supported among mobile browsers, so adding
04:49it to your markup is another way to create consistent form experiences.
04:54Form validation is something you want to plan very carefully as well.
04:57For mobile users, client-side validation is better, as it helps reduce the number of calls
05:02made to the server and improves performance.
05:05For simple validation, most mobile browsers do support the HTML5 required attribute.
05:11However, you're probably going to want to give users more robust feedback than what's
05:15provided by the user agent.
05:17To that end, make sure that the form validation feedback is succinct and displays in a way that
05:23doesn't interrupt the flow of the form or confuse the user.
05:27Placing feedback directly underneath form elements is a good choice for smaller screens.
05:32You also want to make sure that you're using the proper form element.
05:35I know it sounds silly to say something like that, but you have to think about what's appropriate given the context.
05:42For mobile users, it's best to use form elements that makes submitting data easier, automates
05:47input when possible, and even combines form elements to require less input from the user.
05:53For example, rather than giving the user three inputs to submit physical addresses, why not
05:58combine them into a single input and then use placeholder text to show how the address
06:03should be formatted?
06:04Instead of using a radio button grouping of multiple choices, why not replace it with
06:08a single dropdown menu?
06:10Taking time to carefully plan how forms will display on both desktop and mobile devices
06:16will force you to make some difficult decisions.
06:19That leads me to my final point.
06:21In some cases, what works for one context isn't going to necessarily work for another.
06:26Often, you'll be able to use a combination of media queries and JavaScript to modify
06:31forms across devices, but there will be times that creating separate forms from mobile devices
06:36is the better option.
06:38Just be sure to carefully consider user requirements when designing forms and make sure that you're
06:42providing users with the best experience possible across devices.
06:46
Collapse this transcript
Improving site performance
00:00When building responsive designs, designers often get so caught up with the visual design
00:05and functionality of the site that they overlook one of the most critical aspects of building
00:09for multiple devices, and that is site performance.
00:14In designing for the desktop, we become accustomed to creating sites that are built for high-
00:18bandwidth consistent connections.
00:20That's not the case with mobile devices, where you have to deal with a totally different
00:24set of performance issues.
00:25Network connections and bandwidth speed can vary wildly from user to user, or even during a single session.
00:32Network latency can slow sites as well, regardless of connection speeds, and user behaviors like
00:38riding a train or getting into an elevator can affect loading.
00:42So, obviously, if you're going to design across multiple devices and platform, performance
00:47becomes a bigger concern.
00:49There are many ways to improve performance, but perhaps the most overlooked is also the most simple.
00:55Be sure to keep your code as lean and clutter-free as possible.
00:59By using standards-compliant code, eliminating extraneous markup, and keeping your external
01:04scripts and styles as lean and efficient as possible, you'll reduce page sizes and lower
01:10the amount of time it takes to parse your code.
01:13The result can be dramatically faster loading times.
01:16You also want to keep the HTTP requests made by your site to a minimum.
01:21Each time your site requests an image, external CSS file, script, or any resource from the
01:28server, it's an interaction between the device and the server.
01:32Over mobile connections, sites with a high amount of server requests can be slowed down
01:37significantly by network latency and bandwidth speeds.
01:41So how do you limit this requests?
01:43Well, first make sure that you combine external style sheets and scripts, when possible, into single documents.
01:49If you are linking to four different style sheets for desktop, tablet, smartphone, and
01:54print styles, you're making four separate HTTP requests for those resources.
02:00Simply combine them into a single style sheet using @media request.
02:04Yes, the style sheet will be larger in size, but you're always better off by downloading
02:08a larger resource with fewer HTTP request.
02:12Likewise, if you're linking to multiple external scripts, try combining them into a single file.
02:19And development-wise, this can be tricky, but there are tools out there, like the Filament
02:23Group's QuickConcat and Enhance.js, which can combine files at runtime into single request.
02:31You can also reduce requests by modifying how you author your CSS.
02:35If an image isn't needed within the context of the content, meaning it's purely decorative,
02:41change it to a background image and only request it in the appropriate media query.
02:46Not only will this prevent your full-screen banner from downloading to mobile devices,
02:50but it will eliminate the server request for it.
02:53And often you can use styles to eliminate certain requests altogether.
02:58For example, by using gradients, rounded corners, transforms, and other CSS3 techniques, you
03:03can draw simple buttons and icons through CSS and eliminate the need for images in those instances.
03:10You can also combine images and icons into sprites so that you're using the same image
03:15for multiple icons and user interface elements.
03:19This alone can save dozens of HTTP requests.
03:23Using data URIs can lower the amount of server requests as well.
03:26A data URI allows you to embed images directly into your CSS without having to request the
03:32image from the server.
03:34Now it adds a bit to your CSS code so it's really only appropriate for smaller icons
03:39and images, but it can be yet another way to improve performance.
03:44You should also evaluate any external resource to make sure that you're actually using them.
03:49For example, do users really need to download the entire jQuery library to control something
03:54you could write in just a few lines of custom JavaScript?
03:58You should always minify and compress external resources, but it's also a good idea to evaluate
04:03whether or not you really can eliminate some of that redundant or unnecessary code.
04:09It's also pretty common to use a JavaScript library in one context but not the other.
04:14For example, I might use the lettering.js library to fine-tune my typography on a desktop
04:20site, but not use it at all for my mobile app.
04:23Well, if that's the case, why make mobile users download it?
04:26What all these really boils down to is that you need to spend a fair amount of time as
04:30you plan your site making sure that it's structured in a way that maximizes performance.
04:36Any responsive site that's designed to look good on mobile devices should also be designed
04:40to perform well on them.
04:43To learn more about the CSS techniques that I discussed in this movie, be sure to check out
04:47the many wonderful CSS titles in the lynda.com online training library, including my CSS
04:54page layout course, which discusses simple CSS drawing and CSS sprites in more detail.
04:59
Collapse this transcript
3. Responsive Design Strategies
Designing for the appropriate context
00:00I want to discuss some of the strategies that you'll need to consider when approaching responsive design.
00:06To build a successful responsive site, you need to go beyond simply repositioning elements within a layout.
00:12You need to make designing for multiple user contexts an important part of your planning
00:16process and carefully consider how your site should function within those contexts.
00:22At the outset of this chapter, I need to carefully state that responsive design is not the right
00:27solution for every situation, and that I'm not advocating it as the only solution for
00:32designing across multiple devices.
00:34There are going to be times when a separate mobile site or application is the better choice.
00:39As a designer or developer, it's your job to assess the goals of the project and then
00:44determine the appropriate approach.
00:47By learning more about responsive design and its relative strengths and weaknesses, you'll
00:52be able to make better decisions about when and where it's appropriate.
00:55I can state with relative certainty, however, that our days of just designing for the desktop are over.
01:02You can no longer ignore the mobile context, and not designing for it means that a significant
01:07percentage of your site's visitors will have a less-than-ideal experience.
01:12If you've decided that your project doesn't warrant a separate mobile site or application,
01:18you still need to invest some time into thinking about how your site is going to work across different devices.
01:24Currently, many designers work like this.
01:27They develop a site with a client, test it across multiple browsers on a desktop, and
01:32then, as the project nears completion, spend some time thinking about how the content should
01:38look on mobile devices.
01:40Even worse, this stage is often device-specific, as the client will ask for an iPhone or iPad
01:47version of the site.
01:49The end result is often a mess, driven at this late stage by budget concerns or a site
01:55structure that doesn't lend itself to mobile devices.
01:59In my opinion, this is why so many designers tell me that they hate designing for mobile
02:03screens, or that the process of designing across devices is simply too hard.
02:09I always compare this to an engineering team designing a flashy sports car and then, late
02:15in the game, being asked to make sure it has four-wheel drive, can seat a family of five,
02:20and gets good gas mileage.
02:22At that stage of the process, it'd simply be too hard to go back and satisfy all of these requirements.
02:29That's why it's critical to understand the context in which you are now designing.
02:34You have to ensure that your design is targeting the appropriate context in which the site
02:38will be used, and that you understand those contexts well enough to make decisions when
02:43they conflict with each other.
02:45For example, if you are designing a site for a company that sells jellybeans, they might
02:50express the desire to show as much product on the browsing page as possible.
02:55On the desktop, that's fairly simple. That format lends itself to being able to visually
03:00display a large number of items.
03:03But how is that page going to translate to a mobile device?
03:06Well, you could create a slideshow, but for a large number of items, users would likely
03:11find that a tedious way to browse for what they were looking for.
03:15You could create a search feature that allows users to target just the flavor they're looking
03:20for, but how does that translate to allowing customers to discover new flavors?
03:25A better approach would be to consider each of these contexts as the initial design is planned
03:31so a solution can be found that satisfies the user's needs regardless of the device
03:35they're accessing the content on.
03:38This means of course that if you haven't spent much time focusing on designing for the mobile
03:42context, it's time to start.
03:44The mobile space is still relatively new and evolving, so it's only natural that designers
03:49haven't focused on it as much as other contexts.
03:53The reality we find ourselves in now, however, is one where the mobile device has become
03:58an equal partner to desktop devices and in many ways has surpassed them.
04:04That's the main reason that I feel that responsive design is more than just a trend,
04:08it's the proper approach to ensuring that your sites work across as many different devices
04:12and contexts as possible.
04:14
Collapse this transcript
Planning a responsive design
00:00Planning a responsive design can be a frustrating and time-consuming practice, especially if
00:05you've never designed outside of the desktop before.
00:08Responsive design is still evolving, and there aren't many established best practices around planning for it,
00:14so it's likely that you'll evolve your responsive design workflow over the course of several projects.
00:20Now, obviously, each project does different and there is no one-size-fits-all responsive solution.
00:26With that in mind, I do want to go over a few things you need to consider when planning
00:30for responsive design and hopefully provide some insight into how adopting a responsive
00:36design workflow is going to disrupt many of your established processes.
00:41One of the first things that you'll realize when planning a responsive design for the
00:44first time is it's all about the content.
00:48Content strategy has gotten a lot of attention lately, and my guess is that responsive design
00:53is about to take that focus to a whole new level.
00:55You see, at first glance, responsive design appears to be about designing for mobile screen sizes.
01:02However, once you begin mocking up content over multiple screen sizes, you quickly realize
01:07that changes in content placement can dramatically impact a site's effectiveness.
01:13That's why I recommend starting every responsive design by creating a content inventory and
01:18then giving that inventory a hierarchy.
01:21By understanding how much content your site will have and how important that content is
01:26in relation to each other, it becomes much easier to determine how to structure and design
01:31that content across multiple screens.
01:33I've also seen many projects where designers start out with a desktop version of the site
01:39and then begin planning how a mobile or tablet version of the site should look and function.
01:45In my opinion, this is the wrong way to go about it.
01:48In fact, I recommend either starting with a mobile wireframe and then expanding that
01:53to a desktop version, or working on mobile and desktop wireframes simultaneously.
01:59This is more effective because it forces you to be more focused regarding content and
02:05how that content should be presented.
02:07By working in the mobile space first, you force yourself to design within a narrow linear space.
02:14These restrictions help you refine what's really important on the site and how that
02:18content should be presented.
02:20It also helps you plan the initial structure of the page, as you're more likely to understand
02:25how that content is going to change across screen sizes.
02:28This approach also allows you to start thinking about how mobile device capabilities can help
02:33create better experiences with that content, instead of trying to attack on those features
02:38later in the design process.
02:40After you develop a content strategy for the site and initial wireframes for mobile and
02:45desktop, it's time to start thinking about breakpoints.
02:49I've seen some designers obsess over a matrix of device screen sizes and develop
02:54a long list of breakpoints to ensure they're supporting a host of specific devices.
02:59Now, that approach is time consuming and costly.
03:02It can lead to unrealistic expectations about device support, and it ignores the fact that
03:08the diversity of screen sizes will only increase over time.
03:12I feel a better approach is to simply design towards screen sizes and be totally device-agnostic.
03:19Start with your extremes--the small screen size you want to support and then go up to the largest.
03:24Now basically, that means determining where your breakpoints for mobile and desktop are
03:28going to be and whether or not you think it's prudent to design beyond those current standards.
03:34Let's say, for example, that you decide your low-end breakpoint is going to be at 480 pixels
03:39and that your high-end breakpoint will be at 1,200 pixels.
03:43Once you have that range, you could begin thinking about where major changes to the layout
03:47are going to occur.
03:49The easiest way to do this is to plan out what your content is going to look like at
03:53both of those initial stages and then decide when room for extra columns or content regions appear.
04:00Now, notice that I'm not advocating established breakpoints for tablets or portrait and landscape
04:04versions; rather, you're letting the expanding width to the screen dictate the flow of content.
04:10If you take this approach, you'll find that those breakpoints establish themselves naturally,
04:15and you'll end up with three to four major breakpoints that progress your design through
04:19increasingly wider screen sizes.
04:22For most projects, this set will be all you need, and what's nice about this approach is
04:27that it allows you to tweak your layout based on what the available screen size gives you.
04:32For example, let's say you have a list of navigation links that fits nicely between
04:36480 and 1,000 pixels.
04:39However, you notice that if you scale down below 480, the rest of the layout continues
04:43to work fine, but the navigation breaks around 420 pixels.
04:47Since there are several devices out there within that range, perhaps you create another
04:52smaller breakpoint at this size, which only targets the navigation through reducing the
04:57size or removing icons.
04:59These smaller breakpoints, which I call tweak points, allow you to refine your designs throughout
05:04the scaling process.
05:07Another thing you should be thinking about during this process is to what level device
05:11functionality should be considered.
05:13Since smaller layouts lend themselves to smartphones and tablets, it's important to start thinking
05:17about when and if it's appropriate to include device-specific capabilities, like geolocation,
05:24instant messaging, and touch sensitivity.
05:27Thinking about how the site will function within each context is just as important, if
05:31not more so, than how the layout will change and should be planned in parallel to your initial mockups.
05:37Of course, there is a much larger list of things you should consider as you plan content
05:41strategies and breakpoints.
05:43Navigation can be a very difficult problem to solve for responsive design sites so you
05:48should begin solving how navigation is going to work very, very early on the process.
05:53It's also helpful to create consistent coding standards for how content should be structured
05:58and how that content will be styled across media queries.
06:02This step is more important for larger projects or team-based environments, but establishing
06:06standards at the beginning of a project forces you to focus on being consistent throughout
06:11your site, which is crucial for executing responsive designs.
06:15Finally, by considering all of these factors at the very beginning of a project, you can
06:20ask yourself a very important question:
06:23Given the goals of the site, the content involved, and the desire to user experience, can you
06:28create them all within a single document structure?
06:32Often, that answer is no, which will force you to either re-define your goals, modify
06:37the site's content, or realize that an application or separate mobile site might be a better way to go.
06:44Just realize that planning a responsive design is not a simple process.
06:48Like anything else, it will get easier the more you do it, but be prepared to hit some
06:52unexpected roadblocks as you start out.
06:54In fact, I'd advise you to add some time in your planning process to work through some
06:59of the more difficult responsive design issues that are almost certain to appear.
07:03
Collapse this transcript
Building responsive mockups
00:00Responsive design is so new that many of the tools needed to assist designers simply don't exist yet.
00:06That's especially true for wireframing and prototyping tools.
00:10The existing programs and processes are, for the most part, still tied to fixed-width layouts,
00:16which forces designers to find ways to adapt existing tools to evolving workflows.
00:22As with any emerging process, people are still experimenting with techniques that work best for them.
00:28I'm going to cover a few approaches, including my own, to creating responsive mockups, and
00:33then discuss how designers are currently using existing tools to assist their responsive design workflow.
00:39Often I see people start by attempting to create pixel-perfect versions of their layouts
00:45for different devices or screen sizes.
00:48This could result in building anywhere between three to six versions of each mockup, covering
00:53smartphones, tablets, desktops, interactive TVs, and portrait and landscape versions for each device type.
00:59As you can imagine, creating mockups for each of these stages and tweaks isn't very efficient.
01:03For the most part, I've been creating three or four versions of mockups, which feature
01:08small, medium, and large screen sizes, usually correlating smartphones, tablets, and desktop.
01:15The more I work with responsive designs, however, the more I find myself creating initial wireframes
01:20to block content out, and then creating more refined mockups for just the mobile and desktop screen sizes.
01:27And from that point, I design the rest within the browser.
01:31Designing within the browser is harder, and takes a little getting used to.
01:34However, by establishing flexible layouts at the narrow and wider ends of my design,
01:39I can quickly resize the browser and determine exactly the point at which a layout breaks.
01:45This makes it easier to define breakpoints that fit the design and then code incremental tweaks.
01:51I'll be the first to admit that this approach isn't going to be right for everyone or even every project.
01:57Designing within the browser means that you're much further along in the execution of the
02:01site, even as you're still technically in the planning stages.
02:05For larger or more complex sites, this type of approach can be unworkable unless you're
02:10simply creating prototypes.
02:12Regardless of the approach you take, I can't recommend strongly enough making initial sketches
02:17an important part of your design process.
02:20Sketching out wireframes brings a tactile connection to content and functionality planning
02:24that I've never been able to get from digital wireframing.
02:28Plus, it's really easy to rapidly sketch out multiple options and then just throw them
02:32away as you refine them.
02:34There are a number of responsive design sketchbooks and sketch sheets that you can order or download
02:39for free online that make the process of sketching response much easier.
02:43In fact, for the most part, I haven't found a digital tool that matches these sheets in
02:48terms of visualizing content across multiple screen sizes.
02:53Since most traditional tools haven't evolved yet to simulate responsive design, many designers
02:58are turning to some unconventional choices.
03:01Keynote, and to a lesser degree, PowerPoint are increasingly being used to create responsive prototypes.
03:07The large selection of user interface elements, the ability to import custom graphics, and
03:12the animation capabilities give users a way to simulate interactivity and content reflow
03:18within responsive designs.
03:20Other designers are abandoning traditional tools altogether and creating responsive wireframes with HTML and CSS.
03:27Now, their reasoning is that since you need to simulate how content flows responsively,
03:32no other toolset allows you to showcase this as well as HTML and CSS itself.
03:38It also gives the designers an initial framework from which to build the site once the prototypes are approved.
03:44Many existing responsive frameworks--like the one I'm showing you here, Skeleton--are increasingly
03:49becoming not only the foundation for responsive sites, but also the means to prototype them as well.
03:55This approach seems to evenly split the design community, with many finding it an intuitive
03:59way to work, while others just find it tedious and unsuited for larger projects.
04:04In terms of existing tools, I expect to see additions to Adobe's Photoshop, Fireworks,
04:09and Illustrator programs very soon, to assist with responsive designs.
04:13Currently, Fireworks and Illustrator allow multiple pages, or storyboards, which allows
04:18you to create multiple mockups of the same content at different sizes, but Photoshop
04:23is notably lacking in responsive design tools.
04:26So obviously, we're at the stage where we find ourselves waiting for the tools to catch
04:30up to our desired capabilities.
04:33This means that regardless of the approach you adopt or the tools that you use, you
04:37need to find the right technique to communicate how content changes over different screen
04:42sizes and how functionality adapts across multiple devices.
04:47As you search for the proper toolset and techniques and begin to create a responsive workflow
04:51that's right for you, make sure that that remains your focus.
04:54
Collapse this transcript
Developing a content strategy for responsive sites
00:00Good content strategy is critical to responsive design. How critical?
00:05Well, I feel pretty confident in saying that if your responsive design doesn't have a solid
00:10content strategy, it will fail.
00:12In fact, in almost every responsive design that I have seen criticized, the negative
00:17comments have dealt with problems surrounding content, whether the person making the comments
00:22realized that or not.
00:24So, what is content strategy, and why is it so important to responsive design?
00:30Content strategy refers to the practice of identifying, organizing, and managing a site's content.
00:36With the rise of content management systems over the past decade or so, the discipline
00:41has received a lot of attention, with many large organizations now having a dedicated
00:46content strategist on staff.
00:50Just one look at a responsive site will tell you why having a clear content strategy is so important.
00:55On larger screens, it's really easy for the viewer to scan your content and find exactly
01:00what they are looking for.
01:02As screens begin to get smaller, content needs to shift: four columns becomes three, three
01:07becomes two, and two finally becomes one.
01:12At a smaller screen size, users are forced to react to the content that's initially presented to them.
01:17And then they have to actively seek the content they're looking for if it's not immediately visible.
01:23Let's go back for a moment to the site that we were talking about earlier that sells jellybeans.
01:27On the product detail page, you might have the first column display an image of the jellybeans
01:32and a detailed description of the flavor.
01:35To the right of that, maybe you have a list of related flavors that users can browse.
01:40In the third column, maybe you have the purchasing information and a button to add their current
01:44jelly beans to your current order.
01:46Well, that looks fine in the desktop, but what happens when we begin to shrink the screen size?
01:52In most cases, designers simply revert to stacking the content one on top of another
01:57in the order that they're found.
02:00That means that in this case, the purchasing option would be way down the screen on phones,
02:06and users would have to scroll through all the related jelly beans before they could
02:10buy the one they want.
02:11Now, that's a problem.
02:14But it's a content problem, not a responsive one.
02:17So, right away, you can see how difficult the decisions regarding content become.
02:22You are faced with deciding when content shifts, which piece of content appears on top of another,
02:27and when you should hide content, and what type of mechanism to use if you want to enable
02:32users to reveal it.
02:34Above all, your goal should be to create a responsive layout that emphasizes the most important content,
02:40makes the relationships between content clear, and provides ways for accessing content
02:45in an efficient manner on smaller screens.
02:48That's no easy task,
02:49and why it's so important to have a guiding strategy for your site's content.
02:54Now obviously, this is a little easier if you have a content strategist on your team.
02:58But that's not always possible.
03:00And chances are you might have to go this alone, or work with your client to establish
03:04rules around the site's content.
03:06Either way, regardless of the size of your team or whether you're working with a client
03:11or on your own project, there are a few things that you should nail down early on when working
03:15on responsive designs.
03:17First, make sure that you start with the content before you do any other type of planning.
03:23Inventory the content that will appear on your pages, and begin to categorize it.
03:28Think about exactly what the content's purpose is.
03:31How does the page content relate to each other?
03:33Given the goals of the page, which content is the most important?
03:38Is this repeating content across the site or is it specific to just this page?
03:43How many different categories of content do you have, and how are they being used throughout the site?
03:49Content strategists will often design diagrams of your site's content, which can help you
03:53visualize relationships, categorize it, and establish hierarchies.
03:58Breaking your site's content into discrete chunks like this can often lead to surprising
04:02discoveries in terms of how you build pages and group content in unexpected ways.
04:08It will also help you generate a set of rules that govern how content should be displayed
04:12and shifted as screen sizes change.
04:16You can expand on this as you begin to wireframe your pages.
04:19Start with the smallest screen size and then use the page inventory to determine which
04:24content should display first and how users are likely to want to interact with it in related content.
04:30If you have trouble with this, imagine that you can only show one piece of content on the page.
04:35What would it be?
04:37From there, continue to add content, and visualize how users are likely to find and interact with it.
04:44Then begin to wireframe the pages at wider screen sizes.
04:48Determine how the content can expand over large screen real estate in engaging ways.
04:53Creating this content hierarchy and visualizing how it needs to change over screen sizes will
04:58make it much, much easier for you to structure your pages and write your styles.
05:03It also means that you'll be less likely to find yourself in a situation where the page
05:07structure prevents you from reflowing content the way you need to.
05:11Keep in mind that one-size-fits-all content rules are very unlikely to work over a full site.
05:17And in many cases, the decisions you'll make regarding content are likely to be judgment calls.
05:22That's why it's important that you involve as many people as you can in categorizing
05:26and ranking content as early as you can in the process.
05:30Without a clear understanding of the types of content you have, how important it is to
05:34the site's goals, and how it relates to each other, it's impossible to create an effective
05:39responsive design.
05:40
Collapse this transcript
Understanding the mobile context
00:00Throughout this title, I've used the term context to refer to how users experience and
00:06interact with your sites across various devices.
00:09Contexts are useful because they help us make assumptions about how someone will use our
00:14sites, and what their focus, capabilities, and limitations might be as they use it.
00:20We've designed for the desktop context for so long, we're barely conscious of the assumptions
00:24that we make regarding things like the user behavior, screen real estate, browser capabilities,
00:29plug-ins, and bandwidth speed.
00:32Because we've been designing for it for so long, for most of us, it's almost second nature.
00:37However, recently we've had to start considering another context as we design, and that is
00:43the mobile context.
00:45Because it's relatively new and still evolving, I want to take some time to explore the mobile
00:49context and break down some of the myths surrounding it.
00:53When mobile devices first started to connect to the Internet, it was usually through feature
00:57phones on slower network connections.
01:01These devices often lack real browsers and sometimes presented content only through third-party portals.
01:08As their capabilities increased, the experience began to improve, but for the most part, trying
01:14to browse the web through these devices was a frustrating experience.
01:19These experiences led to some underlying assumptions about the mobile web that we're still hearing now.
01:25How often have you heard things like, "Mobile users are on the go.
01:29They don't have time to look at a lot of information, or read long passages of text.
01:34Keep it simple and pare things down," or "Mobile devices have limited browsers and slow connections,
01:40so cut back on features and resources," or my favorite: "Mobile users don't want or need your full site.
01:47It's better to create a smaller separate site and then redirect mobile users to it."
01:53These examples may be a bit extreme, but all too often the term mobile is used to justify
01:59limiting either content, features, or functionality for a group of users.
02:04Frankly, we're making too many assumptions about exactly what a mobile user is.
02:11The truth is, a mobile user is all of us.
02:15Of the 7 billion people in the world, over 77% own a mobile device.
02:22This means that mobile users come in an amazing diversity of behaviors and needs.
02:27Yes, people use mobile devices spontaneously as they wait in line or shop at the mall,
02:33but they also use them in more focused activities like surfing online at home, booking flights,
02:39watching movies, or reading product reviews.
02:42In fact, about the only assumption we can make about mobile users is that they're always
02:47connected; whether they are riding the bus, sitting in bed or finishing a workout, they
02:52have the ability to access your content.
02:56We also tend to make some broad assumptions about mobile devices,
03:00but when you think about it, really, what is mobile?
03:03It's certainly not just phones, as I'd say my laptop is pretty mobile.
03:08What about other devices that are increasingly becoming connected, like cars and shoes and watches?
03:14Are they mobile?
03:16People also often assume that mobile devices have bad or slow connections.
03:20However, when I use my phone or tablet at home, I connect through my high speed network.
03:26Conversely, when I'm on the road, my hotel connection often makes browsing on my laptop painful.
03:32Of course, we do have to account for the reality that mobile users will often have low bandwidth
03:37or high-latency connections, but it's not always the norm.
03:41So, what can we say with certainty about mobile devices?
03:45Well, screen sizes are smaller, which forces us to rethink how we prioritize and present content.
03:52However, the incredible diversity in screen sizes means that we can no longer attempt
03:56to target one size or one device.
04:00Mobile devices are also always connected.
04:03This means that we should plan for mobile users to connect at any time along diverse
04:07network conditions.
04:10Mobile devices also have capabilities and feature sets that desktops don't.
04:15Features like location detection, touch events, accelerometers, built-in phones, and messaging
04:20gives you an opportunity to craft experiences in totally new ways.
04:25If we take these capabilities into consideration as we plan our sites, we're likely to rethink
04:30the ways that users can connect and interact with our content.
04:35Above all, realize that by limiting features or content, you are likely frustrating a large
04:40group of users who want access to it.
04:43It's best not to set artificial conditions by assuming what someone might or might not
04:48want to do on a mobile device.
04:51Instead, start by using the actual constraints of the device as a way of focusing content
04:56so that you're emphasizing what's really important to the user.
05:00In fact, to me, the mobile context really shouldn't focus on behavior at all.
05:05There are simply too many mobile users to try and categorize them into one set of behaviors.
05:10If we really want to reach them, we are better served by looking at the mobile context as
05:15one that focuses on the device's capabilities and practical limitations.
05:20This in turn will help us focus our content, and in the end, give it greater expression.
05:25
Collapse this transcript
Designing for mobile capabilities
00:00If your goal is to create engaging user experiences across multiple devices, then you need to
00:06pay close attention to what those devices can do.
00:09Now, in many ways, embracing responsive design requires us to rethink how we've designed
00:15sites in the past and reexamine how people might want to use and interact with our sites' content.
00:22If you own a smartphone or tablet, you probably already have a good idea as to what they are capable of.
00:28In fact, I'm betting that by now, you're accustomed to using apps or sites that blend together
00:33features like cameras, location detection, and messaging into one seamless experience.
00:39Well, if you are accustomed to it, your users probably are as well.
00:43Now, there is currently an ongoing debate about whether apps or websites are the future of the web,
00:49but I think that argument misses a very important point. For the most part, users don't care.
00:55All they really care about is that your site delivers the experience they expect and since
00:59they are being conditioned to expect integrated feature-rich interactions, you need to understand
01:04what mobile devices are capable of and how to use those features within your responsive design.
01:10And with that in mind, let's take a look at some of the more prominent features of mobile devices.
01:15The very term mobile suggest a device that's portable and allows users to access content
01:20anywhere they happen to be.
01:22So, it makes sense that most mobile devices have some form of location detection that
01:28allows you to determine exactly where the user is and respond accordingly.
01:33Many hand-held mobile devices also support motion detection in the form of accelerometers.
01:38This allows you to respond to motion, hand position, and screen tilt.
01:42Often, this is accompanied by a built-in compass, which also allows you to precisely target device direction.
01:49Another common feature involves audio and media, as devices have microphones, speakers,
01:54and cameras, which allow you to record pictures, video, and audio or access the user's media library.
02:00It's also very common for these devices to have touch screens, which allow your sites
02:04to respond to touch events and gestures.
02:07One of the most overlooked features of mobile devices is the phone itself.
02:12Phone capabilities, messaging, and push notification services allow you to give users multiple
02:17options to connect with, and communicate through, your site.
02:21While this isn't a complete list of all mobile device features, it does illustrate the fact
02:26that if we're planning for our sites to reach across media and devices, we need to start
02:30designing towards those mobile capabilities.
02:33And the first step is to carefully consider whether taking advantage of these features
02:37is appropriate or not, given the goals of your site.
02:40Now, think about how users might anticipate interacting with your content, or what their
02:45expectations might be.
02:47Now, remember, just because you can doesn't mean that you should.
02:50Next, you will have to consider how these features will affect your page structure and
02:54design for larger screen sizes.
02:57How will that functionality be replaced or represented on desktops?
03:01Will you have to hide large portions of your interface, or are there ways to make the same
03:04content behave in a different way based on where it's being viewed.
03:08Now, these are not easy questions, but it's necessary that you think through how these
03:12features will scale in a responsive design.
03:15Unlike building an application, where you can focus on just one user experience, responsive
03:20design forces you to consider functionality across multiple contexts.
03:24And often, this means trade-offs are involved, and many decisions will be judgment calls
03:29based on what you feel will be more effective.
03:31Now, of course some of these features are a little easier to implement than others.
03:36To create a phone number that users can touch to call, all that's really required is you
03:40mark up the phone number in an anchor tag using the telephone URL scheme.
03:45You can then hide the link on desktops using CSS since desktop browsers don't really support it.
03:50Other features, like location detection, involve using JavaScript APIs like geolocation to
03:55capture and respond to data.
03:57While these APIs make it easy for anyone with moderate scripting skills to take advantage
04:01of them, they require a bit more skill and planning to implement properly.
04:06One thing that can help is taking the advantage of the Modernizr JavaScript library.
04:10Modernizr helps you detect support for things like geolocation and touch events, and then
04:14manages resources and scripting based on support.
04:17Since it also allows you testing in some media queries, it's a great way to add that type
04:21of functionality responsively.
04:24And unfortunately, it's not always that simple.
04:26Things can get much trickier if you're attempting to use native device features such as cameras or audio.
04:31Now, often these features require you to use a third-party framework to bridge that gap
04:37between the phone and your site.
04:39At that point, you begin to move away from building responsive designs to building applications,
04:44so you should carefully consider the features that you want to use and then research what's
04:49required to add that functionality.
04:51Once you understand what's involved in implementing it, you will be better prepared to decide
04:55if it's in fact right for your design.
04:58Regardless of what you decide, never lose sight of the fact that it's ultimately about the user.
05:04Remember that they are likely to have certain expectations about what they can do with your
05:07content on mobile, yet they are also likely to visit your site on desktops as well.
05:13You want to make the transition between experiencing the site on mobile and desktop as seamless as possible.
05:18This doesn't mean that the site has to function exactly the same within each context, but
05:23that you should think about what's appropriate in each case and then strike a balance based on what's possible.
05:28
Collapse this transcript
Creating flexible HTML
00:00Although HTML doesn't get as much attention as CSS when responsive design is discussed,
00:06how you structure your HTML is just as important as how you author your styles.
00:12Without carefully planning and structuring your code, you'll never be able to create the
00:15flexible layouts you'll need for a successful responsive design.
00:19In many ways, your HTML needs to be just as flexible as your styles.
00:24If you plan for your sidebar content to reflow a certain way on smaller screens, your page
00:30structure needs to be constructed in a way that's going to allow it.
00:33Obviously, this means that your planning process has to consider both the needs of your code
00:38structure and your styling requirements simultaneously, which may require you to alter your existing workflow.
00:45For environments where the page structure is driven by a CMS or is locked in due to
00:50other factors, you could find yourself limited in terms of your ability to reflow content.
00:55If that's the case, you may have to rework your entire process or find ways to make a
01:00responsive design work within your constraints.
01:03While every project is different, there are a couple of basic things that you can do to
01:08help ensure your HTML will work well with responsive designs.
01:13First and foremost, you should focus on writing clean code without extraneous markup.
01:19That really should be the goal of all web design, but it's especially important for
01:23responsive designs, as cluttered code can make writing multiple layout styles cumbersome.
01:29I also recommend that you adopt HTML5 if you haven't already.
01:34Not only is the authoring process simpler, but it will also requires less overall code,
01:39which in turn creates more lightweight pages.
01:42It also gives you the added benefit of increased semantics.
01:44In responsive design, it's very important that content be easily identifiable and clearly segmented.
01:51HTML5's structural elements, such as article, aside, nav, and section, help you structure
01:56your content in a more meaningful way.
01:58And if you haven't yet, you also need to start exploring microformats as a way of adding
02:03even more meaning to your code.
02:06Not only will they extend your content and make it more searchable, but it will also give
02:10you a way to group content together in a more granular fashion and provides you with content-
02:15specific styling hooks.
02:17As you begin to create more meaningful code, be sure to create standards for how specific
02:22content types and regions are structured.
02:25By thinking through these structures early in the process and making sure that you write
02:29consistent code throughout your site, you're going to make the process of writing responsive
02:33styles a lot easier.
02:36It's entirely possible that adopting responsive design will force you to rethink the way you
02:41structure your HTML, and over time it's really easy to get in the habit of coding the same
02:47repeating structure over and over again.
02:49Now, how many times have you created a basic page structure that includes a header at the
02:54top with navigation, a main article to hold the main content, a sidebar for related content,
03:01and a footer at the bottom?
03:02This structure works fine for the well-established pattern of a two- or three-column layout.
03:08However, for content that needs to reflow in a specific way, or even merge as page sizes
03:13change, this structure might be entirely too rigid.
03:17Making sure that your HTML provides a necessary page structure while giving you the freedom
03:22to reflow content correctly is one of the major challenges of responsive design.
03:27One way that you can make this a little bit easier is to start thinking of content
03:31as discrete chunks of code.
03:34Creating smaller sections of content can provide you with modular content blocks that are easier
03:39to manipulate over multiple layouts.
03:42Now, don't take this approach too far.
03:43The last thing you want to do is have your layout dictate your code structure.
03:48Occasionally, you'll have to make certain trade-offs in order to reach the best solution,
03:52given the goals of your layout.
03:54Just make sure that you never sacrifice accessibility for layout.
03:57In some cases, you simply won't be able to arrive at a structure that will work for all
04:02of your responsive layouts.
04:04At that point, you either have to reassess your page layout goals or you can turn to
04:09scripting for help.
04:10Scripting can be used to replace content, generate content, or even move content on
04:15the fly as conditions change.
04:18Let's say you have a long vertical menu that would take up too much space on mobile screens.
04:23You could simply dynamically replace it on smaller screens with a select menu.
04:28For instances where page structure prevents you from reflowing content properly, you could
04:33create empty placeholder elements for specific content chunks and then use scripting to fill
04:38them with the appropriate content based on the desired layout flow.
04:42Now, this is the approach that the Filament Group uses for their append-around component,
04:47which you can find at their South Street GitHub Repository.
04:50So yes, obviously scripting can be very effective at solving tricky structural issues.
04:55I would caution you, however, not to rely too heavily on scripting for modifying page structure.
05:00It usually requires at least some extraneous markup and can really slow page load times,
05:06in some cases, dramatically.
05:08Now, there will be times what it's the right solution, but if you can achieve the same
05:12results without using it you're better off.
05:14Of course, this entire discussion ignores the bigger issue, which is that current CSS
05:19layout techniques are not suited for responsive design.
05:23Float-based layouts are directly tied to source order, making it almost impossible to dramatically
05:29reorder elements from one screen size to another.
05:33Thankfully, CSS is evolving as well.
05:36Be sure to keep your eye on the W3C's Flexible Box Model, otherwise known as Flex Box, and
05:43on the CSS Grid Template Layout Module.
05:46Now, both of these layout modules promise a degree of source order independence.
05:52Once they're fully implemented across major browsers and devices, it will be much easier
05:56to create responsive design layouts from well-structured HTML.
05:59
Collapse this transcript
Testing responsive designs
00:00Testing is a critical component of any web project, and that's especially true for responsive design.
00:06The trick in testing responsive sites is in accurately testing how your site is going
00:11to look and perform across multiple devices.
00:15Most people test responsive design projects by simply resizing their browser window as
00:20they refine their layouts.
00:23While this type of testing is helpful at giving you immediate feedback, it doesn't accurately
00:28show you how the site will render on mobile browsers, and it ignores performance altogether.
00:34Thankfully, there are a few tools out there that can help you test your responsive designs.
00:39The first thing that most people want to test when designing responsive layouts is their
00:43media queries and whether or not they're hitting the right breakpoints.
00:46Now, you can resize your browser window to test this, but you're not really getting any
00:50feedback as to the actual trigger points themselves, and it's not exactly a speedy process.
00:56In fact, many designers became so frustrated with this that they created a couple of online
01:01tools to help speed up the process and make it a bit more precise.
01:06Benjamin Keen has created a nice bookmarklet that you can add to your browser's bookmark toolbar.
01:11A single click of it will show your current page rendered in as many sizes as you wish.
01:16You simply create the bookmarklet by adding the dimensions you want to test, generate
01:21it, and then you'll be able to test multiple breakpoints at once.
01:25This is extremely handy for testing locally.
01:31The Responsinator isn't a bookmark, but rather, it's a site where you can go ahead and enter
01:36any URL you want and see the page rendered at preset breakpoints that match popular phones and tablets.
01:46Now, there are a lot of online tools like The Responsinator, and doing a quick search will
01:50give you a ton of options.
01:52Two of my favorites are responsive.is, which allows you to enter a URL and simply click
01:58the icon of the device that you want to simulate.
02:01What's nice about this is you see the content actually animate as it reflows.
02:06I also really like Screen Queries.
02:10The thing that I love about this one is that not only you can enter in the URL or test
02:13a page locally, you get a nice grid, which shows you where your breakpoints are,
02:18you can focus on the actual rendering, and scroll down through your designs, and it has
02:24a ton of preset screen sizes and devices that allow you to quickly test across multiple devices.
02:33While examining your breakpoints is an important part of testing responsive design, it shouldn't
02:37be your only concern.
02:39If people are going to be viewing your site on mobile devices, you want to make sure they're
02:43performing properly.
02:45One of the best online mobile tests that I found is Mobitest.
02:48Now this is a free online testing service that allows you to enter the URL of your site
02:53and also choose the device that you want to test on.
02:57Now, once the test is complete, it's going to load up a screenshot of your site on that device.
03:03It's going to tell you what your average load time is. And one of the things I really love about
03:08this, you get this really nice waterfall chart that shows you all of the resources that loaded
03:12for this page and how long it took those resources to load.
03:15So this way you get a little bit of a clearer picture of which resources might be slowing your site down.
03:21It's also especially helpful for checking to see if you're managing your resources properly
03:25and if specific resources either did or did not load based on how you are managing them.
03:31You might also want to look at using mobile emulators for testing, especially if you don't
03:36have access to multiple devices.
03:38Now, a mobile emulator is just that.
03:40It's a program that does its best to simulate a specific mobile device, browser, or operating system.
03:47You can either use online emulators like TestiPhone.com and Opera's Mini simulator, or you can download
03:54and install emulators like Opera's Mobile emulator and the emulators that come with
03:59Apple's iOS SDK and Android's SDK.
04:02In fact, you can pretty much find an emulator for almost any mobile device.
04:08For a more thorough look at emulators, I recommend using mobiForge's excellent article on mobile emulators.
04:13It's a great way to learn where to find them as well as some of the pros and cons to using them.
04:18Now, I think that emulators are a great way to simulate specific mobile environments,
04:23but they can be difficult to set up and they're not always 100% accurate in showing you exactly
04:29how your site is going to behave on an actual device.
04:33Although all the approaches that I've mentioned are helpful nothing, beats testing on the actual device itself.
04:39Now, I know that building a large device library can be expensive, but at a minimum, you should
04:44have a sample of iOS and Android devices to test on.
04:48While you're testing on the devices, you'll need some way to debug your sites so that
04:51you can test for performance and make sure that everything is running the way that it should.
04:56Opera's Remote Debugging tool is a great way to pair Opera's Dragonfly Debugger on your
05:01desktop with the site on a mobile device.
05:06For WebKit remote debugging check out Weinre, or Weinre depending upon how you like to pronounce it.
05:12It lets you set up remote debugging with WebKit Inspector so that you can inspect the pages
05:16running on mobile devices.
05:19You may have gathered from all of the options that I've shown you that testing responsive
05:23designs can be a bit of a pain.
05:26Well, if you're not used to testing sites across multiple devices, you should be prepared
05:30to have a slower-than- usual testing cycle at first.
05:33You should also be prepared for having to deal with an entirely new system of browser
05:38bugs as you add mobile browsers to the mix.
05:41However, once you begin to understand what works and what doesn't, you'll adopt the testing
05:46workflow that allows you to make sure your sites work as well as possible across multiple
05:50browsers and devices.
05:51
Collapse this transcript
Conclusion
Exploring fluid grid frameworks
00:00In our final chapter, I want to leave you with some helpful resources that can make
00:04it easier for you to experiment with, and adopt, responsive design.
00:08I'll start by showing you some of my favorite fluid grid frameworks.
00:13Using an existing fluid grid framework can speed up development, help keep code consistent
00:18across projects, and give you a solid starting code base.
00:21You know, they're not for everyone however, as they can add unnecessary code to your sites
00:26and occasionally require non-semantic markup.
00:28So, whether or not you use them for your own responsive sites is largely a matter of personal choice.
00:34I encourage you to examine as many of these frameworks as possible and try them out before
00:39committing to them for a specific site.
00:41I'm going to start by showing you a couple of grid-only options and then moving on to
00:46a few full frameworks.
00:50The Golden Grid System is a folding grid system that features an 18-column grid, which folds
00:55down to eight and four columns respectively as it hits tablet and mobile breakpoints.
01:00It also features elastic gutters, a baseline grid with presets designed to accommodate
01:05user scaling, and a nice add-on script that allows you to overlay your grid over your
01:10content as you design.
01:13Simple Grid is a grid system with four pre-built breakpoints for targeting multiple screen sizes.
01:20While the grid isn't fluid out of the box, it is very lightweight and easy to modify
01:24with your own layout values based on the grid structure.
01:28Its class naming system also makes it easy to create nested columns to build more complex layouts.
01:37Columnal is a fluid grid based off of an earlier non-responsive grid framework.
01:42It features nestable columns, classes that control vertical spacing, pre-built wireframing
01:47templates, and a PDF of the grid system that can help you sketch out your ideas before you code.
01:55The Responsive Grid System is a very flexible responsive grid that allows you to decide
01:59how many columns you need, modify and add as many breakpoints as you want, and section
02:04up content in intelligent ways.
02:07You're also encouraged to either download the entire grid or just the pieces that you need to work with.
02:15Gridset is a new service focused on making it easier for designers to create fluid grids.
02:21The site allows you to set parameters for your grid and then generates the grid for
02:25you based on your requirements.
02:27You're allowed to save grids, reuse them, or create new ones based on layout needs.
02:31Now, as of this recording, Gridset is in beta, but it should be available to everyone soon.
02:39If you're looking for something a bit more robust, you might want to consider adopting
02:43a full-featured framework or boilerplate.
02:47Foundation 3 is responsive framework that includes a fluid grid, prototyping features,
02:52and presets for typography, forms, navigation, and other site elements that take the work
02:58out of starting cross-browser-compliant responsive sites.
03:02Check out the foundation website for a full list of features.
03:07A mobile framework that's been getting a lot of attention lately is Twitter's Bootstrap;
03:12it's a collection of HTML, CSS, and JavaScript that includes a fluid grid, starter layouts,
03:18UI components, and much, much more.
03:20It's an incredibly comprehensive solution to developing responsive sites, and you can
03:24download it for free from Twitter's GitHub repository.
03:30The Mobile Boilerplate is a companion framework to the HTML5 boilerplate, and even though
03:36it doesn't contain a fluid grid, I'm including it here because of its incredible focus on
03:41building mobile-friendly sites.
03:43It's designed to provide cross-browser consistency on all major smartphones and provides fallback
03:49support for older devices, and it gives you features like offline caching and polyfills
03:53from media query support.
03:55It's actually a really great way to start any responsive site and fluid grids can be
03:59used in conjunction with it. I also want to mention Skeleton, one of my
04:05favorite responsive frameworks.
04:07Skeleton is lightweight, includes a fluid grid, basic typography controls, and default
04:13styling for forms and buttons.
04:16Unlike other frameworks, skeleton provides you only the very basics in styling, meaning
04:20that it's designed to give you a solid foundation upon which to build your own unique styles.
04:26Of course that's not all the fluid grid systems and frameworks out there.
04:29I encourage you to try out the ones I've shown here and search for other frameworks that you can use.
04:34Have fun experimenting with them, carefully consider which features you'll need, and be
04:39honest about comparing the benefits of using them to the downsides that they might bring
04:43to your projects as well.
04:45
Collapse this transcript
Looking at responsive design tools
00:00Unfortunately, many of the capabilities we need to create truly responsive designs either
00:05don't exist at the current time or are unevenly supported across user agents.
00:11Thankfully, there are lots of people in organizations working very hard to make creating responsive
00:17designs easier and to plug the holes in some of those existing capability gaps.
00:22I'd like to show you some of the tools that can make creating responsive designs a little
00:25easier and some that can help you ensure that your responsive designs work across as many
00:31devices as possible.
00:33I really like to sketch my ideas out first before I move on to creating code.
00:38To me, this helps me visualize how my content will be presented and work through a site's
00:43responsiveness before actually authoring any of the CSS.
00:47That's why I absolutely love the responsive web designs sketch sheets created by Jeremy Alford.
00:52You can download the sheets, print them out, and be brainstorming your responsive design in minutes.
00:59Instead of using an existing fluid grid, you might want to build your own.
01:03Two tools that I really like in this regard are Tiny Fluid Grid and Fluid Grids.
01:08Now Tiny Fluid Grid has a very simple interface that allows you to set some quick parameters
01:15and then download the resulting grid.
01:19Fluid Grids is a bit more manual, as it allows you to enter to the total number of columns
01:23you want and let's say the width of those columns and then the width of the gutters.
01:28All you have to do is click Get the grid.
01:31It'll go ahead and generate the grid for you and allow you to copy and download that.
01:36You know, even if you're not keen on using somebody else's grid, both of these tools
01:40are great ways to examine exactly how fluid grids are built.
01:45Once you start building responsive sites, you'll soon realize how many deficiencies
01:49 there are in terms of implementations.
01:52There is very little in the way of built-in feature detection, resource management, and
01:56content switching in our current browsers.
01:58Well, thankfully, many tools are being developed to address that.
02:01Now, the first one I want to show you is Categorizer.
02:03Now, this is a device-detection script that determines whether the user agent is a desktop
02:09device, TV, tablet, or smartphone.
02:11Now from there, you can load necessary resources, redirect pages, or perform platform-specific actions.
02:19If you've watched any of my previous tiles, you've probably seen me talk about Modernizr.
02:24Modernizr is the current standard in feature detection, as it allows you to quickly determine
02:28if a specific feature is supported and then load resources, styles or content, based on the results.
02:34Modernizr features asynchronous resource loading, an ability to test against the
02:39results of media queries, which makes it an indispensable tool for responsive design.
02:45Earlier, we discussed how difficult responsive images are.
02:48The same can be certainly said for responsive video as well, which is why fitvids.js is
02:54such a welcome tool.
02:56This jQuery plug-in allows you to quickly create fluid video embeds on your page that
03:01are also cross-browser-compliant.
03:04Although you'll find this actually baked in to many of the responsive design tools that
03:08you'll use, it's worth discussing respond.js by the Filament Group on its own.
03:14Because older user agents didn't support media queries, responsive sites are often seen as
03:18not being very backwards-compatible.
03:20Respond.js is a very lightweight polyfill that enables media query support on older browsers.
03:29The Filament Group has several tools that can help make your life easier when designing responsive sites.
03:35Overflow helps ensure consistent support for the CSS overflow property among mobile devices.
03:41Since inconsistent support can create serious user interface problems when scrolling through
03:45content, this is a very useful tool.
03:49And even though I've already mentioned it, I want to recommend Filament Group's Southstreet toolset again.
03:55Filament Group refers to Southstreet as a progressive enhancement workflow.
03:59Now, it's essentially a set of tools that they've developed over the years for building responsive,
04:04cross-device web applications and sites.
04:07It's amazing to me that a leading developer of responsive designs would developed these
04:12tools around the best practices that they've evolved and then put them out there for free.
04:17But that's exactly what the Filament Group has done.
04:19If you're going to be designing responsive sites, you need to at least examine these
04:23tools and learn from their processes.
04:26Finally, I want to mention response.js.
04:30This is a jQuery library that focuses on building responsive designs.
04:34It has features that let you swap code blocks for different devices and a little responsive
04:38images and triggers for responding the screen sizes or device features.
04:43Be sure to check it out and see if it has features that you can use.
04:46Now, obviously some of the tools I've mentioned here are more technical than others.
04:51Don't be intimidated if you don't quite understand what a tool does or how to implement it.
04:56Just make sure you experiment with some of the tools I've mentioned here, so that when
04:59issues arise as you build responsive sites, you'll be ready to deal with them.
05:04
Collapse this transcript
Additional resources
00:00I want to thank you for watching Responsive Design Fundamentals.
00:04I hope that you have a clearer overall picture of what responsive design is and how adopting
00:09responsive design will affect your overall workflow.
00:12Before I finish, I want to leave you with a few of the responsive-design-focused blogs
00:16and sites that I read on a regular basis.
00:19Reading these can help you dive deeper into responsive design and perhaps more importantly,
00:24keep an eye on how it evolves.
00:26First, I recommend bookmarking the Filament Group's lab page.
00:30You've probably heard me mention the Filament Group a couple of times during this title.
00:34They are a web development agency that specializes in building experiences across devices and platforms.
00:41Their lab page is a fantastic collection of articles that document their processes and
00:45observations resulting from their work.
00:48Since they are at the forefront of responsive design, it's well worth your time to keep
00:52an eye on their site.
00:54I also recommend Luke Wroblewski's lukew.com site.
00:59Luke is the author of Mobile First and one of the leading proponents of mobile-friendly design.
01:04This is perhaps the best resource online to learn about designing for the mobile context.
01:09It's also a good idea to keep your eye on unstoppablerobotninja.com, if you don't already.
01:17This is the online blog of Ethan Marcotte, author of responsive design and in many ways
01:22the first designer to articulate the concepts behind it.
01:26I'm also a big fan of Brad Frost and his blog, BradFrostweb.com.
01:31Brad writes articles and tutorials that focus on responsive design, and is one of the leading
01:36voices on designing across multiple contexts.
01:39Of course, I also recommend checking out all of the web and mobile design and development
01:44courses in the lynda.com online training library.
01:48We're adding new responsive design titles to the library all the time, so be sure to
01:52check back frequently.
01:53Well, that's all for now.
01:56Feel free to drop me a line on my blog, www.simpleprimate.com, or join the conversation on Twitter, where
02:03you can reach me by tweeting or following @jameswillweb.
02:07Thanks again for watching everyone, and I'll see you in my next lynda.com title.
02:11
Collapse this transcript


Suggested courses to watch next:

Web Design Fundamentals (2h 43m)
James Williamson

Creating a Responsive Web Design (1h 31m)
Chris Converse


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 98,405 instructional videos.

start free trial learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 1,893 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.


site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked