The 960 Grid System
The 960 Grid System
complex layouts so easily. However, since I was fairly new to web design at the time, when I downloaded the files, I quickly became overwhelmed at how complicated the whole thing seemed. With all this code, how could this be the easy way to create a layout? This article is for web designers and front-end web developers who are interested ingrid-based layout systems but are at a loss on how to decipher them. Well focus specifically on the 960 Grid System, but after reading this guide, youll find that most of the other grid systems out there are similar and will make much more sense after you understand a few basic principles.
Grid-Based Design
Before we get into the specifics of the 960 Grid System, lets briefly discuss gridbased design in general. The idea is certainly not something that originated on the Web. In fact, it stems from one of the oldest and most basic design principles: alignment. Our brains like to simplify things to make them readily understandable. This is why we try to impose order on things that seem chaotic, like seeing a face in the craters on the moon. Naturally, the easier it is to impose order, the quicker our brains can identify a pattern and move on. Grids are so organized and orderly that they require almost no interpretation our part. Consider the two page layouts represented in the image below.
Though both of these images are simply a gathering of rectangles, the layout at the top seems fundamentally better than the one on the bottom. We can instantly recognize a pattern, accept it, and move on. The image on the bottom, however, is visually unsettling by comparison. Theres no clear pattern, order, or goalits just looks like a random assortment of shapes. Our eyes have a tendency to frantically search for fractions of a second while we attempt to identify a trend, which increases the time necessary to take in the scene as a whole. Its interesting to note that random can still be beautiful. Random definitely has its place in nature, art, and even design, but its no way to logically organize information.
The point is that grids are among the simplest and strongest ways to create order on a page. They may seem cold and rigid, but remember that they are both extremely efficient and effective, and can even be quite flexible if you dont let your imagination get bogged down by the necessary structure.
The 960 Grid System is simply a way to lay out websites using a grid that is 960 pixels wide. The reason its 960 pixels wide is because the number 960 makes for a lot of clean divisions utilizing whole numbers when factoring in column widths and margins. And it fits nicely on the majority of screens. The 960 GS comes in two primary variants: a 12-column grid and a 16-column grid (a 24-column version is included as well for those that really need extra control). In the 12-column version, the narrowest column is 60 pixels wide. Each column after that increases by 80 pixels. So the available column widths are: 60, 140, 220, 300, 380, 460, 540, 620, 700, 780, 860 and 940.
Similarly, in the 16-column version, the narrowest column is 40 pixels wide and each column after that increases by 60 pixels. So the available column widths are: 40, 100, 160, 220, 280, 340, 400, 460, 520, 580, 640, 700, 760, 820, 880 and 940.
This naming system makes it incredibly easy to hash out complicated layouts in seconds flat. To fill a pages width, the trick to keep in mind is that the numbers assigned to your selected classes must equal 12 in the 12-column version and 16 in the 16-column version. For instance, using the 12-column version, if you have 3 divs of text that you want to be displayed side-by-side in a 3-column layout, simply assign the grid_4 class to each one to total 12 (4+4+4=12).
Similarly, assigning the grid_4 CSS class in the 16-column version makes it easy to create a 4-column layout (4+4+4+4=16).
To make sure youre referring to the proper classes, be sure to place your 12-column elements inside a div with the class container_12 and your 16-column classes inside a div with the class called container_16. If youve never worked with the 96 GS before, I hope youre having your "aha" moment right now regarding just how easy it is to spec out a layout in no time at all using this system.
Keep in mind that you can push items as far as you want. If I had wanted to push an element two columns over, I wouldve implemented the class push_2, and so on. The push/pull system has major implications for how you lay out a page in your HTML document. For instance, in the example below, imagine the websites name is typed out in a logo and placed as the first element on the page. As the most important element on the page, youd like to keep the logo as the first item in your HTML markup, but visually, you actually want it to appear in the center of the page.
Before pushing/pulling:
To visually position the logo element in between the two text columns, you would use the following HTML:
<div class="grid_6 push_3"> <p>logo</p> </div>
After pushing/pulling:
Despite the fact that the logo comes first in our markup, it will be visually positioned in the center of our page.
As you can see, the example above uses a suffix_3 class to create an empty space the width of three columns after it.
Lets Review
Armed with this newfound knowledge, you should now be a 960 Grid System expert. To review, there are basically only 5 concepts you need to remember:
1. Use the container_12 class for the 12-column version and the container_16for the 16-column version. 2. Use the classes grid_1, grid_2, grid_3, etc. to set your column widths. If you want to fill a page horizontally, make sure the numbers add up to 12 or 16 (i.e.grid_4 + grid_2 + grid_6 = 12). 3. Use the push and pull classes to independently position items on the page, regardless of their position in your pages markup. 4. Use the prefix and suffix classes to create empty spaces in your layout. 5. Use the alpha and omega to fix the margins for any nested grid units. There is also a CSS reset included with the 960 Grid System. This is a completely optional file based on the ever popular Eric Meyer CSS reset. If you like it, keep it. If not, trash it!
Typogridphy
From the site: "Typogridphy is a CSS framework constructed to allow web designers and front-end developers to quickly code typograhically pleasing grid layouts.
Related Content
A Brief Look at Grid-Based Layouts in Web Design The Evolution of Web Design The Brads Alignment in Design Related categories: Web Design and Web Development