Table of Contents for
Responsive Web Design with HTML5 and CSS3 Essentials

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Responsive Web Design with HTML5 and CSS3 Essentials by Asoj Talesra Published by Packt Publishing, 2016
  1. Cover
  2. Table of Contents
  3. Responsive Web Design with HTML5 and CSS3 Essentials
  4. Responsive Web Design with HTML5 and CSS3 Essentials
  5. Credits
  6. About the Authors
  7. About the Reviewer
  8. www.PacktPub.com
  9. Preface
  10. What you need for this book
  11. Who this book is for
  12. Conventions
  13. Reader feedback
  14. Customer support
  15. 1. Introducing Responsive Web Design
  16. Exploring how RWD works
  17. Understanding the elements of RWD
  18. Appreciating the importance of RWD
  19. Comparing RWD to adaptive design
  20. Preparing our development environment
  21. Considering a suitable strategy
  22. Exploring best practices
  23. Setting up a development workflow
  24. Exploring mistakes
  25. Summary
  26. 2. Creating Fluid Layouts
  27. Understanding the different layout types
  28. Setting the available viewport for use
  29. Exploring the benefits of flexible grid layouts
  30. Understanding the mechanics of grid layouts
  31. Implementing a prebuilt grid layout
  32. Exploring the use of flexbox
  33. Visiting the future
  34. Taking it further
  35. Summary
  36. 3. Adding Responsive Media
  37. Making video responsive
  38. Making text fit on screen
  39. Summary
  40. 4. Exploring Media Queries
  41. Understanding media queries
  42. Identifying common breakpoints
  43. Putting our theory into practice
  44. Creating some practical examples
  45. Examining some common mistakes
  46. Exploring best practices
  47. Taking things further
  48. Summary
  49. 5. Testing and Optimizing for Performance
  50. Understanding why pages load slowly
  51. Optimizing the performance
  52. Testing the performance of our site
  53. Best practices
  54. Providing support for older browsers
  55. Considering cross-browser compatibility
  56. Testing site compatibility
  57. Following best practices
  58. Summary

Chapter 5. Testing and Optimizing for Performance

Throughout the course of this book, we've explored some of the essentials of responsive web design, using HTML5 and CSS3, and learned how to begin to modify our code to make content responsive across different devices.

We should keep in mind that building just a responsive website is not enough—we must also test and optimize content to work as efficiently as possible across different devices. If pages on our site are slow to load, then this will clearly be a concern. Throughout the course of this chapter, we will look at some of the tips and tricks we can use to begin to ensure that our sites are sufficiently responsive and content loads quickly.

In this chapter, we will cover the following topics:

  • Exploring why pages load slowly
  • Optimizing the performance of our sites
  • Measuring site performance
  • Testing for cross-browser compatibility
  • Exploring best practices

Curious? Let's get started!

Understanding the importance of speed

The advent of using different devices that can access the Internet means speed is critical—the time it takes to download content from hosting servers and how quickly the user can interact with the site are key to the success of any site.

Why it is important to focus on the performance of our website on the mobile devices or those devices with lesser screen resolution? There are several reasons for this, they include the following:

  • Nearly 80 percent of Internet users own a smartphone
  • Around 90 percent of users go online through a mobile device, with 48% of users using search engines to research new products
  • Approximately 72 percent of users abandon a website if the loading time is more than 5–6 seconds
  • Mobile digital media time is now significantly higher compared to desktop use

If we do not consider statistics such as these, then we may go ahead and construct our site, but end up with a customer losing both income and market share, if we have not fully considered the extent of where our site should work. Coupled with this is the question of performance; if our site is slow, then this will put customers off and contribute to lost sales.

A study performed by San Francisco-based Kissmetrics shows that mobile users wait between 6–10 seconds before they close the website and lose faith in it. At the same time, tests performed by Guy Podjarny for the Mediaqueri.es website (http://mediaqueri.es) indicate that we're frequently downloading the same content for both large and small screens; this is entirely unnecessary when, with some simple changes, we can vary content to better suit desktop PCs or mobile devices!

So, what can we do? Well, before we start exploring where to make changes, let's take a look at some of the reasons why sites run slowly.