September 19th, 2005
Five simple steps to designing grid systems — Part 5
It’s been a while, but this is the final part in my series ‘Five Simple Steps to designing Grid Systems’.
Flexible vs Fixed. Which one to choose? Why choose one over the other? Well you won’t find the answers to those questions here. What I’m aiming to do with this article is to investigate how the theory of grid design can be applied to a flexible web page.
Lets’s start by briefly examining Fixed and Flexible, or Fluid designs.
They both have their merits.
Fixed width designs are, well, just easier to produce. The designer has control over the measure, and therefore the legibility (until the user increases or decreases the font size that is).
Flexible width designs scale to the user’s resolution, and therefore the browser window. There is less empty space, typically at the side of fixed width designs.
However, they both also have the down sides such as fixed layouts generally scale badly and flexible layouts tend to look very wide and short. But, this article is not about the good and the bad and it’s not really the place for that type of discussion, that argument is going on elsewhere and will continue to do so for quite some time.
Flexible grids
As discussed the first few parts of this series, grid system design deals in fixed measurements — the media size, the type size and ultimately the grid size. They are all fixed. So, along comes the Web and challenges theory which has been around for generations. All of a sudden the reader can resize the media, they can change the font size, they can do all this stuff that designers didn’t have to think about before. Designers have had to adapt, both to the technology and to the opportunities that media offers.
I’ve been giving flexible width a lot of thought over the past few weeks in preparation for writing this article. I can see the merits in both, but I’ve been trying to base my recent thought within the realms of purest grid theory. How does that theory translate to flexible grid design? and I think the answer is, quite well actually.
Adaptive Grid Systems
Ideally grid systems should be designed around the type size. Column widths, and therefore the Measure, should be constructed in such a way to maximise legibility based on the number of characters (you can read more about that in my Five Simple Steps to Better Typography). This is all fine if the units of measurements are fixed, but what if they can change? But what does that mean?
- The user can change the font size
- The user can resize the browser window
- The user can change their resolution
The user can of course do this with all design, fixed or flexible, but the key to flexible grid systems is the grid must adapt to those changes. After a bit of thought I think the key components of an adaptive grid are:
- The grid elements adapt to the user’s changes, and
- The grid must retain it’s orginal proportions
I’ve never been comfortable with the desciptions of flexible grids — flexible, elastic etc. What I’m trying to convey with Adaptive Grid Systems or Adaptive Layouts is the thought process behind the grid design which reacts to the user’s choices. I think it appeals to the purist in me! ;)
It’s a question of ratios. Again.
In the first two parts of this series, I talked about ratios, both rational and irrational, in the construction of grid system design. But, for those who haven’t read them, or have forgotten, here’s a quick overview.
Grid systems can be constructed from ratios. Simple ratios such as 1:3, or 2:1 are called rational ratios. More complex ratios, such as those based on the Golden Section (1: 1.618) , are called irrational ratios.
Ratios are just the job for constructing adaptive grid systems because they are independent of any unit of measurement. They are just a ratio to the whole, whatever the whole may be. This whole, be a browser window or whatever, can change and therefore so does the ratio or the grid.
Let me put this into practice now with a working grid.
Divine measurements
If you’ve been following these articles, you should know by now that I like to start simple. Following on from several articles I’ve written about the golden section, I’ll continue with that and construct this adaptive grid using the Golden Section which is an irrational ratio — 1:1.618.
So first off we construct a simple two column grid system with the content areas being defined by the Golden Section ratio.

Getting the right units
In order for a grid to be adaptive, we have to use scalable units of measurement such as 100% or Ems. Just a reminder: An Em (pronounced ‘m’ NOT ‘e, m’) is a typographic measurement equal to the point size of the typeface you are using. We also use percentages.
To give us our column width I convert the ratio’s to percentages, which gives us 61.8% for the main column and 38.2% for the right column.

That’s our grid as determined by percentages. Pretty easy really. Now, on to the implementation.
Constructing the grid in CSS
Before I move headlong into implementing this using CSS, I just wanted to point out that this tutorial is about grid design and not about web standards. XHTML and CSS just happens to be the tools I use to realise this design. You can of course use tables if you want (but you’d be wrong!). Oh, and I’m just not clever enough to stuff this example full of hacks for IE this, Mac that, weird linux browser version 0.6.1 etc. etc. This example is a Best Case Scenario example. If you want to add all that stuff to it, let me know and I’ll add it. Like I said, it’s the grid that interests me. Disclaimer over.
Oh, and there’s a small change to the percentages of the columns to get round some browser bug or another, it’s basically a couple of percentage smaller so the floats work correctly.
For those who can’t be bothered going through this code, here’s the example.
Here’s the CSS, including all the global stuff such as links, typographic stuff and general body stuff which is applied to a pretty basic XHTML structure.
body {
margin: 0 auto;
padding: 0;
font-family: "Lucida Grande", verdana, arial,
helvetica, sans-serif;
font-size: 62.5%;
color: #333;
background-color: #f0f0f0;
text-align: center;
}
* {
padding: 0;
margin: 0;
}
/* Make sure the table cells show the right font */
td { font-family: "Lucida Grande", verdana, arial,
helvetica, sans-serif; }
/*--------------------------------------
GLOBALS & GENERAL CASES
---------------------------------------*/
a {text-decoration: underline; padding: 1px; }
a:link { color: #03c; }
a:visited { color: #03c; }
a:hover { color: #fff; background-color: #30c;
text-decoration: none; }
/*--------------------------------------
TYPOGRAPHY
---------------------------------------*/
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, arial, verdana, sans-serif;
font-weight: normal;
}
/* approx 21px*/
h1 {
font-size: 2.1em;
margin-top: 2em;
}
/* approx 16px*/
h2 {
font-size: 1.6em;
margin-bottom: 1em;
}
/* approx 14px*/
h3 {
font-size: 1.4em;
}
/* approx 12px*/
h4 {
font-size: 1.2em;
}
/* approx 11/14 */
p {
font-size: 1.1em;
line-height: 1.4em;
padding: 0;
margin-bottom: 1em;
}
I then add the page structure css.
The columns are wrapped with a container div (called ‘container’), this is defined as being 90% wide, with a minimum width of 84 em. What’s that about? Well I got that number by doing this.
As mentioned earlier, our ideal minimum width for the measure is 52 em. This is the width of our main column and as determined by the Golden Section, the overall column widths combined is 1.62 multiplied by 52 em, which is 84 em. The right column is therefore 84 em minus 52 em, which is 32 em. Converting these to percentages gives us 62% and 38%, which is what you use in the CSS for each column.
There is also a minimum width of 84 em applied to the overall container, which when the user resizes the text, maintains the ratios.
Here’s the CSS for the columns:
#container {
width:90%;
margin:0 auto;
text-align: left;
min-width: 84em;
}
#contentframe {
margin: 2em 0 0 0;
padding: 2em 0;
width: 100%;
text-align: left;
float: left;
border: 1px solid #ccc;
background-color: #fff;
}
/* 2 column layout c1-c1-c2 */
.c1-c2 #c2 {
float: right;
width: 36.2%;
padding: 0 0 0 1em;
margin: 0;
}
.c1-c2 #c1 {
float: left;
width: 61.8%;
padding: 0 0 0 1em;
margin: 0;
}
So, there we have it. An Adaptive Grid System based on the Golden Section.
Please feel free to abuse the hell out of this layout. Push it, stretch it, batter it into submission. Please let me know though what your findings are. Are Adaptive Layouts the way forward in flexible grid design for the web. Like I said, I’m interested in the grid, not necessarily in the implementation.
That wraps up another series
Well, there we are. Another series finished with. Hope you liked it, and thanks for all the comments and feedback. I’ve got a feeling this one’s going to be interesting…
This is the fifth, and final, installment of this “Simple Steps…” series.
- Subdividing ratios
- Ratios and complex grid systems
- Grid systems for web design: Part 1
- Grid systems for web design: Part 2 Fixed
- Grid systems for web design: Part 3 Fluid
I must say that, although I love this whole series, this installment wasn’t as informative as the other four. As much as it you stress the grid over the implementation, it seemed to be more of an exercise in building a flexible grid with CSS rather than the concepts of a flexible grid.
I would have liked to hear more of your thoughts about the impact of certain size relationships when the grid is adaptive. None of that is to discount the value of what you’ve written; I just believe that there’s more we can all learn from you about this specific topic, especially from the merit of the past four.
Excelent article. It has been a pleasure following the series.
Just an issue on the example, though; on Firefox (1.0.6 on Linux, FWIW), the right column “sinks” in every font size from “Normal” up; down is OK.
Dan — I’m afraid that was always going to be the case with this last part. Flexible, or Adaptive grids have been around for, what, maybe a few years? Fixed grids have been around centuries. I’m afraid I don’t have all the answers, in fact I may well have asked more than answered with this installment.
Adaptive grid systems are a relatively new direction in grid system design. In fact, I’m not sure if anything else has been written about them. So, I think this will be only the first few steps into fully understanding the theory begind them.
Finally the last step. It’s been a moment following your guides.
Thank you Mark.
In this example, how would you prevent the main column from pushing the sub column down when resizing the text?
Thanks for the articles Mark, very helpful.
Mark I was looking forward to this article as I am a big fan of elastic design using em as the only unit of measure (except for images).
I found your combination of fluid and elastic interesting, but on past experience it is a very difficult path fraught with danger (like your columns self destructing at certain font sizes).
If you want to see your golden grid used in an elastic design where the line length is fixed, but the font size and page width varies according to your browser width, try my variation.
Bad link writng
Should be [url=“http://nickcowie.com/other/golden_section.html”]
try my variation[/url]
Nick — That’s a really interesting solution. I know the realisation of adaptive grid systems was going to be fraught with difficulty, not only the theory involved, but also the browser implementation.
The only issues I can see with the adaptive layout you’ve built is it’s not common browser behaviour, and therefore the user could be confused with resizing of the text.
Also, there seems to be a wee bug. When you resize the text manually, then try and resize the browser window, it all goes a bit screwy. That’s in Safari btw.
Bugs aside, a really interesting direction in adaptive layouts. Thanks Nick.
Mark
The changing font size based on browser is a little radical, and might have problems when your font size is much larger than default (I could not get any real screwy behaviour with Safari 1.3, Firefox or even IE 5 on a PC.)
All versions of the grid on the web have problems.
Fixed in pixels, does not allow IE users to change font size (bad accessibility/usability and in other browsers look damn weird when the font size is increased.
Fluid design (% of browser width) can self destruct at small widths and at large widths be impossible to read. My 1280px screen is 180 characters wide at 10 px.
Elastic design, fixing the width to the best reading line length is only way to go in my opinion.
Thanks for a great series, it’s been very helpful! You may want to proofread it again; some sentences don’t flow fluently or seem to quit in the middle. Also, as Nick says, your example doesn’t work in some browsers in some font sizes (mine: Mac Firefox at 1024x768). Otherwise, nice work, I learned a lot again!
Interesting series, you’ve taught me I need to pay closer attention to my grids, thanks!
Like Nick, I too was expecting the columns to adapt as the text was scaled?
I like the article. I guess there is a great deal more to say about this. It is very hard for us designers to give up control, like Mark said in previous articles. So the flexible layout are a solution. Stretch it from 800 to 1024 px is not such a problem. But how far do you want to go? Is a design made for 1024 px suitable for a mobile phone? In the future we may go back to diferent designs for different sizes / media when the Media Queries are fully implemented.
Take a look at [url=http://www.rammstein.com]http://www.rammstein.com[/url] and resize your browser. You will see the design change. Now view it on your mobile phone, you will yet see another design (if you have Opera 8, view it in Opera and press Shift + F11 to view it small screen. The Opera homepage is a good example too).
So what is the path we should follow? I don’t know. But there will be some more discussion, technical innovation and user acceptance. And the future ofcourse, which is hard to predict.
It seems that a big hack is needed to to cope with the w3c box model (which in my opinion is completley wrong and IEs model should have been adopted).
You have to guestimate % amounts for your margin and padding ems so the boxes aren’t larger than you think. eg, c1 has to be 62% — (margin_ems + padding_ems). Am I missing something?
Shudder. When do you ever want the internal measurements of a box? In my experience at least, you want a box that fills X amount of space. And to calculate that you have to take account of all the other little bits and pieces in your css.
Cheers,
Ryan
can you explain why the body has 62% font –size
cheers
oz
The 62.5% percent font-size is there in order to having managable numbers
“BODY {font-size:62.5%}
This takes 16px down to 10px, which apart from being less huge is a nice round number. From now on it?s easy to think in pixels but still set sizes in terms of ems: 1em is 10px, 0.8em is 8px, 1.6em is 16px, etc. “
from Clagnut:
http://www.clagnut.com/blog/348/
[…] grid-based design and walks your through designing a grid from scratch. Here are parts 2, 3, 4, and 5, and the preface to the […]
[…] grid-based design and walks your through designing a grid from scratch. Here are parts 2, 3, 4, and 5, and the preface to the […]
[…] grid-based design and walks your through designing a grid from scratch. Here are parts 2, 3, 4, and 5, and the preface to the […]
[…] Five simple steps to designing grid systems — Part 5 (on liquid grids, by Mark Boulton) […]