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

Following best practices

A key question we must ask ourselves is to what extent we will support the use of particular browsers when developing our websites. The answer to this will lie in monitoring analytical software, to determine which browsers are being used.

In most cases, it should show modern browsers being used, but there are still limited instances of old browsers in use; for example, IE6 is still being used, although its market share is now a tiny 0.25%, as at April 2016. This raises the question of what we should support, if monitoring analytics for our sites shows that only a tiny percentage (that is, lower than 1%, for example) of usage is for older browsers, then we may take the decision to not support them if the effort and resources required do not justify the return from such a small market share.

This said, there are some basic tips that can help us optimize our sites:

  • We should avoid using hacks where possible. Conditional comments are a better option, although we should regularly check and remove styles if they are no longer applicable (such as vendor prefixes, which no longer apply).
  • Try to use <!DOCType html> in your code. This will indicate to the browser that it should follow HTML5 rules; it will degrade automatically if the browser does not support HTML5.
  • We can use the W3C Validation Service to check our code for consistency. A better option though is to build this into part of the development process; we can easily do this with Node.js, so it can be done automatically.
  • In the age of modern sites, JavaScript has become an essential tool for development. It is all too easy to resort to using it, without really considering the options available. Try to avoid using JavaScript if possible. It was designed to complement existing code, and should not be relied on to provide core functionality. The state of CSS is such now that styling functionality that previously was only possible with JavaScript may now be feasible with CSS and provide smoother results to boot!