O'Reilly logo

Responsive Web Design with HTML5 and CSS3 Essentials by Asoj Talesra, Gaurav Gupta, Alex Libby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required