Book Image

Responsive Web Design with HTML5 and CSS3 Essentials

By : Alex Libby, Gaurav Gupta, Asoj Talesra
Book Image

Responsive Web Design with HTML5 and CSS3 Essentials

By: Alex Libby, Gaurav Gupta, Asoj Talesra

Overview of this book

Responsive web design (RWD) is a web design approach aimed at crafting sites to provide an optimal viewing and interaction experience—providing easy reading and navigation with minimum resizing, panning, and scrolling—and all of this across a wide range of devices from desktop computer monitors to mobile phones. Responsive web design is becoming more important as the amount of mobile traffic now accounts for more than half of the Internet’s total traffic. This book will give you in depth knowledge about the basics of responsive web design. You will embark on a journey of building effective responsive web pages that work across a range of devices, from mobile phones to smart TVs, with nothing more than standard markup and styling techniques. You'll begin by getting an understanding of what RWD is and its significance to the modern web. Building on the basics, you'll learn about layouts and media queries. Following this, we’ll dive into creating layouts using grid based templates. We’ll also cover the important topic of performance management, and discover how to tackle cross-browser challenges.
Table of Contents (11 chapters)
Responsive Web Design with HTML5 and CSS3 Essentials
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface

Putting our theory into practice


Throughout the course of this chapter, we've covered the different parts that make up media queries as I am sure someone once said, it is time.

Yes, it's time to put this into practice. Before we start creating some real-world examples, let's create something we can use to explore the effects of adding a media query to code. We'll start by resizing some simple boxes on screen:

  1. From the code download, go ahead and extract a copy of queryexample.html and save it to our project area.

  2. In a text editor, go ahead and add the following styles; we'll start with some basic styles for our boxes:

            body { background-color: #F3ECDD; text-align: center; 
              font-family: Arial, sans-serif; color: #ffffff; 
              min-width: 33%; } 
     
            .box { width: 100%; background: #905f20; border-radius: 0.625em; 
              margin: 0; } 
     
            .box2{ min-width: 100%; background: #6b8e6f; border-radius: 
              0.625rem...