Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $9.99/month after trial. Cancel anytime.

Responsive Web Design with HTML5 and CSS3 Essentials
Responsive Web Design with HTML5 and CSS3 Essentials
Responsive Web Design with HTML5 and CSS3 Essentials
Ebook313 pages2 hours

Responsive Web Design with HTML5 and CSS3 Essentials

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

About This Book
  • Get to grips with the core functionality of RWD through examples
  • Discover how to make layouts, content and media flexible, and explore why a content-first approach is more effective
  • Maximize the performance of your web pages so that they work across all browsers and devices irrespective of the screen size
Who This Book Is For

This book is for web designers who are familiar with HTML and CSS, and want to begin with responsive web design. Web development experience and knowledge of HTML5 and CSS3 is assumed.

LanguageEnglish
Release dateAug 29, 2016
ISBN9781783553082
Responsive Web Design with HTML5 and CSS3 Essentials

Related to Responsive Web Design with HTML5 and CSS3 Essentials

Related ebooks

Internet & Web For You

View More

Related articles

Reviews for Responsive Web Design with HTML5 and CSS3 Essentials

Rating: 5 out of 5 stars
5/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Responsive Web Design with HTML5 and CSS3 Essentials - Asoj Talesra

    Table of Contents

    Responsive Web Design with HTML5 and CSS3 Essentials

    Credits

    About the Authors

    About the Reviewer

    www.PacktPub.com

    eBooks, discount offers, and more

    Why subscribe?

    Preface

    What this book covers

    What you need for this book

    Who this book is for

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Downloading the color images of this book

    Errata

    Piracy

    Questions

    1. Introducing Responsive Web Design

    Getting started with RWD

    Exploring how RWD works

    Understanding the elements of RWD

    Controlling the viewport

    Creating flexible grids

    Making media responsive

    Constructing suitable breakpoints

    Appreciating the importance of RWD

    Making our site accessible and intuitive

    Organizing our content

    Comparing RWD to adaptive design

    Preparing our development environment

    Considering a suitable strategy

    Exploring best practices

    Designing for touch

    Setting up a development workflow

    Discovering the requirements

    Planning our site

    Designing the text

    Sketching our design

    Prototyping and creating our design

    Testing our design

    Exploring mistakes

    Summary

    2. Creating Fluid Layouts

    Introducing flexible grid layouts

    Understanding the different layout types

    Setting the available viewport for use

    Balancing viewport against experience

    Considering viewport units

    Exploring the benefits of flexible grid layouts

    Understanding the mechanics of grid layouts

    Implementing a prebuilt grid layout

    Exploring the use of flexbox

    Taking a closer look

    Visiting the future

    Implementing a basic gallery grid

    Exploring what happened

    Taking it further

    Summary

    3. Adding Responsive Media

    Making media responsive

    Creating fluid images

    Implementing the element

    Using the srcset attribute

    Exploring the sizes attribute

    Manipulating the HTML5 element

    Putting it all together

    Exploring what happened

    Creating a real-world example

    Taking things further

    Making video responsive

    Embedding externally hosted videos

    Introducing the new HTML5 video element

    Embedding HTML5 video content

    Exploring what happened

    Building a practical example

    Exploring what happened

    Exploring the risks

    Making audio responsive

    Taking things further

    Making text fit on screen

    Sizing with em units

    Using rem units as a replacement

    Exploring use of viewport units

    Taking things further

    Summary

    4. Exploring Media Queries

    Exploring some examples

    Understanding media queries

    Exploring the available media types

    Listing the available media features

    Introducing operators in our queries

    Identifying common breakpoints

    Creating custom breakpoints

    Understanding the rationale

    Taking care over our design

    Removing the need for breakpoints

    Putting our theory into practice

    Creating some practical examples

    Making it real

    Exploring what happened

    Detecting high-resolution image support

    Exploring how it works

    Examining some common mistakes

    Exploring best practices

    Taking things further

    Summary

    5. Testing and Optimizing for Performance

    Understanding the importance of speed

    Understanding why pages load slowly

    Optimizing the performance

    Starting with Google

    Taking things further

    Testing the performance of our site

    Working through a desktop example

    Viewing on a mobile device

    Best practices

    Providing support for older browsers

    Considering which features to support

    Let the user choose what they want

    Do we need to include a whole library?

    Considering cross-browser compatibility

    Outlining the challenges

    Understanding the drawbacks of JavaScript

    Providing a CSS-based solution

    Testing site compatibility

    Working out a solution

    Exploring tools available for testing

    Viewing with Chrome

    Working in Firefox

    Exploring our options

    Following best practices

    Summary

    Responsive Web Design with HTML5 and CSS3 Essentials


    Responsive Web Design with HTML5 and CSS3 Essentials

    Copyright © 2016 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: August 2016

    Production reference: 1240816

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham 

    B3 2PB, UK.

    ISBN 978-1-78355-307-5

    www.packtpub.com

    Credits

    About the Authors

    Alex Libby has a background in IT support. He has been involved in supporting end users for almost 20 years in a variety of different environments; a recent change in role now sees Alex working as an MVT test developer for a global distributor based in the UK. Although Alex gets to play with different technologies in his day job, his first true love has always been with the open source movement, and in particular experimenting with CSS/CSS3, jQuery, and HTML5. To date, Alex has written 11 books on subjects such as jQuery, HTML5 Video, SASS, and CSS for Packt, and has reviewed several more. Responsive Web Design with HTML5 and CSS3 Essentials is Alex's twelfth book for Packt, and second completed as a collaboration project.

    Writing books has always been rewarding. It's a great way to learn new technologies and give back something to others who have yet to experience them. My thanks must go to Packt and my coauthors for letting me review and assist with editing this book. My special thanks must also go to family and friends for their support too—it helps get through the late nights!

    Gaurav Gupta is a young and budding IT professional and has a good amount of experience of working on web and cross-platform application development and testing. He is a versatile developer and a tester and is always keen to learn new technologies to be updated in this domain. Passion about his work makes him stand apart from other developers.

    Even at a relatively early stage of his career, he is a published author of two books, named Mastering HTML5 Forms and Mastering Mobile Test Automation with Packt Publishing.

    A graduate in computer science, he currently works for a reputed Fortune 500 company and has developed and tested several web and mobile applications for the internal use.

    Gaurav is a native of Chandigarh, India, and currently lives in Pune, India.

    First of all, I would like to thank the almighty and my family, who have always guided me to walk on the right path in life. My heartfelt gratitude and indebtedness goes to all those people in my life who gave me constructive criticism, as it contributed directly or indirectly in a significant way toward firing up my zeal to achieve my goals. A special thanks to my sister, Anjali, who is a constant support, always.

    Asoj Talesra is an enthusiastic software developer with strong technical background. As a hybrid mobile app developer, he is responsible for crafting and developing intuitive, responsive web pages, and mobile apps using HTML5, CSS3, JavaScript, AngularJS, jQuery, jQuery Mobile, Xamarin, and Appcelerator Titanium. He works with a Fortune 500 company, and is well experienced in the areas of banking, quality and compliance, and audit.

    About the Reviewer

    Sasan Seydnejad has more than a decade of experience in web UI and frontend application development using JavaScript, CSS, and HTML in .NET and ASP.NET environments. He specializes in modular SPA design and implementation, responsive mobile-friendly user interfaces, AJAX, client architecture, and UX design, using HTML5, CSS3, and their related technologies. He implements framework-less and framework-based applications using Node.js, MongoDB, Express.js, and AngularJS. He is the holder of the US patent for a user interface for a multidimensional data store—US Patent 6907428.

    www.PacktPub.com

    eBooks, discount offers, and more

    Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

    At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

    https://www2.packtpub.com/books/subscription/packtlib

    Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

    Why subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print, and bookmark content

    On demand and accessible via a web browser

    Preface

    A question—how many devices do you own that can access the Internet?

    As a user, I'll bet the answer is likely to be quite a few; this includes smart TVs, cell phones, and the like. As developers, it is up to us to provide a user experience that works on multiple devices. Welcome to the world of responsive design!

    Responsive design is not only all about creating a great user experience, but one that works well on multiple different devices, from a simple online ordering process for tickets, right through to an extensive e-commerce system. Many of the tips you see throughout the course of this book don't require extensive changes to your existing development methodology. In many cases, it's enough to make some simple changes to begin building responsive sites.

    Creating responsive sites can open up a real world of opportunity for you; over the course of this book, I'll introduce you to the essential elements that you need to be aware of when designing responsively, and provide you with examples and plenty of tips to help get you started with creating responsive designs.

    Are you ready to get started? Here's hoping the answer is yes. If so, let's make a start.

    What this book covers

    Chapter 1, Introducing Responsive Web Design, kicks off our journey into the world of responsive design, with an introduction into the basics of the concept; we explore the importance of RWD in today's environment and examine how it works as a concept.

    Chapter 2, Creating Fluid Layouts, takes a look at creating flexible grid layouts as a key element of our design process; we explore the benefits of using them, and take a look at creating some examples using prebuilt styles.

    Chapter 3, Adding Responsive Media, walks us through how to make our media responsive. We cover some of the tips and tricks available for use and examine why, in some cases, it is preferable to host content externally (such as videos)—if only to save on bandwidth costs!

    Chapter 4, Exploring Media Queries, leads us to explore media queries and how we can use them to control what content is displayed at particular screen width settings. We cover the basics of creating breakpoints and examine why these should be based around where content breaks in our design and not simply for specific devices we want to support.

    Chapter 5, Testing and Optimizing for Performance, rounds off our journey through the essentials of responsive web design with a look at how we can test and optimize our code for efficiency. We explore some of the reasons why pages load slowly, how we can measure our performance, and understand why even though the same tricks can be applied to any site. It's even more critical that we incorporate them when designing responsively.

    What you need for this book

    All you need to work through most of the examples in this book is a simple text or code editor, an Internet browser, and Internet access. Many of the demos use Google Chrome, so it is ideal if you have this installed; other browsers can be used, although there may be instances where you have to change the steps accordingly.

    Who this book is for

    The book is for frontend developers who are familiar with HTML5 and CSS3, but want

    Enjoying the preview?
    Page 1 of 1