The personal disquiet of

Mark Boulton

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 design­ing Grid Systems’.

Flex­ible vs Fixed. Which one to choose? Why choose one over the other? Well you won’t find the answers to those ques­tions here. What I’m aim­ing to do with this art­icle is to invest­ig­ate how the the­ory of grid design can be applied to a flex­ible web page.

Lets’s start by briefly examin­ing Fixed and Flex­ible, or Fluid designs. 

They both have their merits. 

Fixed width designs are, well, just easier to pro­duce. The designer has con­trol over the meas­ure, and there­fore the legib­il­ity (until the user increases or decreases the font size that is). 

Flex­ible width designs scale to the user’s res­ol­u­tion, and there­fore the browser win­dow. There is less empty space, typ­ic­ally at the side of fixed width designs.

How­ever, they both also have the down sides such as fixed lay­outs gen­er­ally scale badly and flex­ible lay­outs tend to look very wide and short. But, this art­icle is not about the good and the bad and it’s not really the place for that type of dis­cus­sion, that argu­ment is going on else­where and will con­tinue to do so for quite some time.

Flex­ible grids

As dis­cussed the first few parts of this series, grid sys­tem design deals in fixed meas­ure­ments — the media size, the type size and ulti­mately the grid size. They are all fixed. So, along comes the Web and chal­lenges the­ory which has been around for gen­er­a­tions. All of a sud­den the reader can res­ize the media, they can change the font size, they can do all this stuff that design­ers didn’t have to think about before. Design­ers have had to adapt, both to the tech­no­logy and to the oppor­tun­it­ies that media offers.

I’ve been giv­ing flex­ible width a lot of thought over the past few weeks in pre­par­a­tion for writ­ing this art­icle. I can see the mer­its in both, but I’ve been try­ing to base my recent thought within the realms of purest grid the­ory. How does that the­ory trans­late to flex­ible grid design? and I think the answer is, quite well actually.

Adapt­ive Grid Systems

Ideally grid sys­tems should be designed around the type size. Column widths, and there­fore the Meas­ure, should be con­struc­ted in such a way to max­im­ise legib­il­ity based on the num­ber of char­ac­ters (you can read more about that in my Five Simple Steps to Bet­ter Typo­graphy). This is all fine if the units of meas­ure­ments are fixed, but what if they can change? But what does that mean?

  1. The user can change the font size
  2. The user can res­ize the browser window
  3. The user can change their resolution

The user can of course do this with all design, fixed or flex­ible, but the key to flex­ible grid sys­tems is the grid must adapt to those changes. After a bit of thought I think the key com­pon­ents of an adapt­ive grid are:

  1. The grid ele­ments adapt to the user’s changes, and
  2. The grid must retain it’s orginal proportions

I’ve never been com­fort­able with the des­cip­tions of flex­ible grids — flex­ible, elastic etc. What I’m try­ing to con­vey with Adapt­ive Grid Sys­tems or Adapt­ive Lay­outs is the thought pro­cess behind the grid design which reacts to the user’s choices. I think it appeals to the pur­ist in me! ;)

It’s a ques­tion of ratios. Again.

In the first two parts of this series, I talked about ratios, both rational and irra­tional, in the con­struc­tion of grid sys­tem design. But, for those who haven’t read them, or have for­got­ten, here’s a quick overview.

Grid sys­tems can be con­struc­ted from ratios. Simple ratios such as 1:3, or 2:1 are called rational ratios. More com­plex ratios, such as those based on the Golden Sec­tion (1: 1.618) , are called irra­tional ratios.

Ratios are just the job for con­struct­ing adapt­ive grid sys­tems because they are inde­pend­ent of any unit of meas­ure­ment. They are just a ratio to the whole, whatever the whole may be. This whole, be a browser win­dow or whatever, can change and there­fore so does the ratio or the grid. 

Let me put this into prac­tice now with a work­ing grid.

Divine meas­ure­ments

If you’ve been fol­low­ing these art­icles, you should know by now that I like to start simple. Fol­low­ing on from sev­eral art­icles I’ve writ­ten about the golden sec­tion, I’ll con­tinue with that and con­struct this adapt­ive grid using the Golden Sec­tion which is an irra­tional ratio — 1:1.618.

So first off we con­struct a simple two column grid sys­tem with the con­tent areas being defined by the Golden Sec­tion ratio.

{title}

Get­ting the right units

In order for a grid to be adapt­ive, we have to use scal­able units of meas­ure­ment such as 100% or Ems. Just a reminder: An Em (pro­nounced ‘m’ NOT ‘e, m’) is a typo­graphic meas­ure­ment equal to the point size of the typeface you are using. We also use percentages.

To give us our column width I con­vert the ratio’s to per­cent­ages, which gives us 61.8% for the main column and 38.2% for the right column.

{title}

That’s our grid as determ­ined by per­cent­ages. Pretty easy really. Now, on to the implementation.

Con­struct­ing the grid in CSS

Before I move head­long into imple­ment­ing this using CSS, I just wanted to point out that this tutorial is about grid design and not about web stand­ards. XHTML and CSS just hap­pens to be the tools I use to real­ise 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 ver­sion 0.6.1 etc. etc. This example is a Best Case Scen­ario 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. Dis­claimer over. 

Oh, and there’s a small change to the per­cent­ages of the columns to get round some browser bug or another, it’s basic­ally a couple of per­cent­age smal­ler so the floats work correctly.

For those who can’t be bothered going through this code, here’s the example.

Here’s the CSS, includ­ing all the global stuff such as links, typo­graphic stuff and gen­eral 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 struc­ture css.

The columns are wrapped with a con­tainer div (called ‘con­tainer’), this is defined as being 90% wide, with a min­imum width of 84 em. What’s that about? Well I got that num­ber by doing this.

As men­tioned earlier, our ideal min­imum width for the meas­ure is 52 em. This is the width of our main column and as determ­ined by the Golden Sec­tion, the over­all column widths com­bined is 1.62 mul­ti­plied by 52 em, which is 84 em. The right column is there­fore 84 em minus 52 em, which is 32 em. Con­vert­ing these to per­cent­ages gives us 62% and 38%, which is what you use in the CSS for each column.

There is also a min­imum width of 84 em applied to the over­all con­tainer, which when the user res­izes the text, main­tains 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 Adapt­ive Grid Sys­tem based on the Golden Section.

Please feel free to abuse the hell out of this lay­out. Push it, stretch it, bat­ter it into sub­mis­sion. Please let me know though what your find­ings are. Are Adapt­ive Lay­outs the way for­ward in flex­ible grid design for the web. Like I said, I’m inter­ested in the grid, not neces­sar­ily in the implementation.

That wraps up another series

Well, there we are. Another series fin­ished with. Hope you liked it, and thanks for all the com­ments and feed­back. I’ve got a feel­ing this one’s going to be interesting…

This is the fifth, and final, install­ment of this “Simple Steps…” series.

  1. Sub­divid­ing ratios
  2. Ratios and com­plex grid systems
  3. Grid sys­tems for web design: Part 1
  4. Grid sys­tems for web design: Part 2 Fixed
  5. Grid sys­tems for web design: Part 3 Fluid

20 Responses to “Five simple steps to designing grid systems — Part 5”

  1. Dan Mall said on: September 19th, 2005 at 7:39 pm

    I must say that, although I love this whole series, this install­ment wasn’t as inform­at­ive as the other four. As much as it you stress the grid over the imple­ment­a­tion, it seemed to be more of an exer­cise in build­ing a flex­ible grid with CSS rather than the con­cepts of a flex­ible grid. 

    I would have liked to hear more of your thoughts about the impact of cer­tain size rela­tion­ships when the grid is adapt­ive. None of that is to dis­count the value of what you’ve writ­ten; I just believe that there’s more we can all learn from you about this spe­cific topic, espe­cially from the merit of the past four.

  2. Jo?o Craveiro said on: September 19th, 2005 at 7:40 pm

    Excelent art­icle. It has been a pleas­ure fol­low­ing the series.

    Just an issue on the example, though; on Fire­fox (1.0.6 on Linux, FWIW), the right column “sinks” in every font size from “Nor­mal” up; down is OK.

  3. Mark Boulton said on: September 19th, 2005 at 8:05 pm

    Dan — I’m afraid that was always going to be the case with this last part. Flex­ible, or Adapt­ive grids have been around for, what, maybe a few years? Fixed grids have been around cen­tur­ies. I’m afraid I don’t have all the answers, in fact I may well have asked more than answered with this installment.

    Adapt­ive grid sys­tems are a rel­at­ively new dir­ec­tion in grid sys­tem design. In fact, I’m not sure if any­thing else has been writ­ten about them. So, I think this will be only the first few steps into fully under­stand­ing the the­ory begind them.

  4. Kuswanto said on: September 20th, 2005 at 12:36 am

    Finally the last step. It’s been a moment fol­low­ing your guides. 

    Thank you Mark.

  5. dan said on: September 20th, 2005 at 1:10 am

    In this example, how would you pre­vent the main column from push­ing the sub column down when res­iz­ing the text?

  6. Matt said on: September 20th, 2005 at 2:14 am

    Thanks for the art­icles Mark, very helpful.

  7. Nick Cowie said on: September 20th, 2005 at 5:15 am

    Mark I was look­ing for­ward to this art­icle as I am a big fan of elastic design using em as the only unit of meas­ure (except for images). 

    I found your com­bin­a­tion of fluid and elastic inter­est­ing, but on past exper­i­ence it is a very dif­fi­cult path fraught with danger (like your columns self destruct­ing at cer­tain 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 var­ies accord­ing to your browser width, try my vari­ation.

  8. Nick Cowie said on: September 20th, 2005 at 10:07 am

    Bad link writng 

    Should be [url=“http://nickcowie.com/other/golden_section.html”]

    try my variation[/url]

  9. Mark Boulton said on: September 20th, 2005 at 10:45 am

    Nick — That’s a really inter­est­ing solu­tion. I know the real­isa­tion of adapt­ive grid sys­tems was going to be fraught with dif­fi­culty, not only the the­ory involved, but also the browser implementation. 

    The only issues I can see with the adapt­ive lay­out you’ve built is it’s not com­mon browser beha­viour, and there­fore the user could be con­fused with res­iz­ing of the text. 

    Also, there seems to be a wee bug. When you res­ize the text manu­ally, then try and res­ize the browser win­dow, it all goes a bit screwy. That’s in Safari btw.

    Bugs aside, a really inter­est­ing dir­ec­tion in adapt­ive lay­outs. Thanks Nick.

  10. Nick Cowie said on: September 20th, 2005 at 1:44 pm

    Mark

    The chan­ging font size based on browser is a little rad­ical, and might have prob­lems when your font size is much lar­ger than default (I could not get any real screwy beha­viour with Safari 1.3, Fire­fox or even IE 5 on a PC.) 

    All ver­sions 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 char­ac­ters wide at 10 px. 

    Elastic design, fix­ing the width to the best read­ing line length is only way to go in my opinion.

  11. Jeroen Coumans said on: September 21st, 2005 at 4:27 pm

    Thanks for a great series, it’s been very help­ful! You may want to proofread it again; some sen­tences don’t flow flu­ently 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 Fire­fox at 1024x768). Oth­er­wise, nice work, I learned a lot again!

  12. Steve Williams said on: September 22nd, 2005 at 1:17 am

    Inter­est­ing series, you’ve taught me I need to pay closer atten­tion to my grids, thanks! 

    Like Nick, I too was expect­ing the columns to adapt as the text was scaled?

  13. Bertje said on: September 26th, 2005 at 11:43 am

    I like the art­icle. I guess there is a great deal more to say about this. It is very hard for us design­ers to give up con­trol, like Mark said in pre­vi­ous art­icles. So the flex­ible lay­out are a solu­tion. Stretch it from 800 to 1024 px is not such a prob­lem. But how far do you want to go? Is a design made for 1024 px suit­able for a mobile phone? In the future we may go back to difer­ent designs for dif­fer­ent sizes / media when the Media Quer­ies are fully implemented. 

    Take a look at [url=http://www.rammstein.com]http://www.rammstein.com[/url] and res­ize 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 fol­low? I don’t know. But there will be some more dis­cus­sion, tech­nical innov­a­tion and user accept­ance. And the future ofcourse, which is hard to predict.

  14. Ryan said on: December 29th, 2005 at 3:10 am

    It seems that a big hack is needed to to cope with the w3c box model (which in my opin­ion is com­plet­ley wrong and IEs model should have been adopted). 

    You have to gues­tim­ate % amounts for your mar­gin and pad­ding ems so the boxes aren’t lar­ger than you think.  eg, c1 has to be 62% — (margin_ems + padding_ems).  Am I miss­ing something? 

    Shud­der.  When do you ever want the internal meas­ure­ments of a box?  In my exper­i­ence at least, you want a box that fills X amount of space.  And to cal­cu­late that you have to take account of all the other little bits and pieces in your css.

    Cheers,

    Ryan

  15. oz said on: January 16th, 2006 at 1:58 am

    can you explain why the body has 62% font –size

    cheers 

    oz

  16. Erik Larsson said on: February 3rd, 2006 at 1:45 pm

    The 62.5% per­cent font-size is there in order to hav­ing man­agable numbers 

    “BODY {font-size:62.5%} 

    This takes 16px down to 10px, which apart from being less huge is a nice round num­ber. 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 Clag­nut:

    http://www.clagnut.com/blog/348/

  17. Ultimate Guide To Grid-Based Web Design: Techniques and Tools « Tech7.Net said on: November 10th, 2009 at 2:13 pm

    […] grid-based design and walks your through design­ing a grid from scratch. Here are parts 2, 3, 4, and 5, and the pre­face to the […]

  18. Ultimate Guide To Grid-Based Web Design: Techniques and Tools | Graphic Design Pro said on: November 13th, 2009 at 10:21 pm

    […] grid-based design and walks your through design­ing a grid from scratch. Here are parts 2, 3, 4, and 5, and the pre­face to the […]

  19. Ultimate Guide To Grid-Based Web Design: Techniques and Tools | qface & sowmo sky said on: November 17th, 2009 at 10:54 pm

    […] grid-based design and walks your through design­ing a grid from scratch. Here are parts 2, 3, 4, and 5, and the pre­face to the […]

  20. zomigi.com » 70+ essential resources for creating liquid and elastic layouts said on: January 25th, 2010 at 8:06 pm

    […] Five simple steps to design­ing grid sys­tems — Part 5 (on liquid grids, by Mark Boulton) […]

  • Me

    Hello. My name is Mark Boulton. I’m a designer, an author, a speaker and I run a small design agency where we work with lovely cli­ents and pub­lish books as we go. This is my blog.

  • More of me

  • Publications

    Design­ing for the Web
    Start­ing from £19 + VAT for a PDF Down­load. £29 for a full col­our paperback.
  • Where I work

    Mark Boulton Design
    A small design stu­dio doing good things for nice clients.
    Five Simple Steps
    Pub­lish­ing easy to read design books.
  • See me speak

    @Media 2010
    June 8th — 11th, Lon­don, UK.
    Drupal­Con 2010
    August 23th — 27th, Copen­ha­gen, Denmark.
    dCon­struct 2010: Design 1010 workshop
    Septem­ber 1st, Brighton, UK.
    Web­d­a­gene
    Septem­ber 29th — Octo­ber 1st, Oslo, Norway
    Web Developers Conference
    Octo­ber 27th, Bris­tol, UK.
    New Adven­tures in Web Design
    Janu­ary 20th 2011, Not­ting­ham, UK.
  • Copyright © 1999–2010 Mark Boulton. Made with an Apple Mac in Wales. Running on WordPress and VPS.net.