-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering CSS
By :

In this section, we'll discuss the first of the three main components of responsive web design, the fluid grid, or a percentage-based layout. We'll look at converting a fixed width layout into a fluid grid, and to do this, you'll need to learn the formula for converting pixels into percentages.
Right now, we have a fixed width layout, as shown in the following screenshot:
If you shrink the browser, you can see how it breaks down into smaller sizes, as shown in the following screenshot:
Creating a fluid grid is the first step in fixing this. The goal is to convert all our pixel-based widths, as well as left and right margins and left and right padding, into percentages. We're going to ignore our main navigation for now, but we'll circle back to it in a later section. We'll start with the div
tag, which is the wrapper
class, that I have used to wrap a lot of the content. Let's change the property width
to max-width
. This indicates that this element...