Jello: A Different Liquid Layout
Note: This page has nothing whatsoever to do with the gelatin dessert, Jell-O. It’s describing a technique for web designers. The current version of it is described in my article for P.I.E.
This new design sports what I believe to be a brand new way of creating a website that is flexible relative to one’s browser.
Since the majority of my small readership are not CSS nerds, I’ll start with a little background. Feel free to skip over that if you just want the code. (If you don’t want any of it, the final example is right here)
Liquid And Fixed Layouts
Since the beginning of visual presentation for the web, there’s been a debate online about whether it’s more appropriate to publish a website that changes relative to the size of the browser, or stays a consistent width.
This is primarily a design-debate that’s only new because no other medium in the history of the universe has been served up in a format where the end-user has so much control over the experience.
Many good discussions can be found elsewhere, so I won’t insert a diatribe here, but instead link to a decent summary at Whitespace.
There are additional technical and aesthetic challenges in implementing a liquid layout, but I’d like to present this trick as a way of softening a few of them, and addressing some of the concerns that Scrivs points out in that Whitespace article.
Jello
Jello is halfway between a liquid and a solid — it’s got a little of both.
I wanted a layout that would expand in the browser, but not expand in a way directly proportional to the width. Something that would be 770px wide in an 800px viewport, but not have to be 1232px wide in a 1280px viewport.
What was the solution? Make a layout that’s a fixed pixel amount plus some percentage of the remaining amount. Chances are, you’ve already resized your browser to see how this page changes shape at different widths, and you can see this effect in action.
Implementation
I owe a thanks here to Mr. Brill, for pointing out the utility of negative margins.
To get the result I’ve described, you simply work in reverse: Chop off half the fixed amount from each side of the page, make a percentage-width column in the middle of that, and then bust out of the two sides using a negative margin for whatever that fixed quantity was.
Here’s the first example.
If you’re viewing it in a browser that works, you see the intended effect, at its bare bones. But uh-oh, not every browser works.
Fixing Bugs
IE does strange things to negative margins unless you float the parent, and position it relative. That’s an easy fix.
It also botches the interior percentages. But that’s no problem, just wrap the inside in a container set to width: 100%;. (This is also convenient because it may be used as a vehicle for easyclearing)
But wait… it’s still messed up. If you just load the page, it staggers along okay. But go ahead and try resizing it. You get a strange flickering/shifting/whatever that is rather unpleasant. What’s the fix here?
An Alternative Approach
If we can’t bust out of both sides of the flexible middle column, what about just one of them? Take the whole bite out of the right side, and then shift it back with relative positioning?
Here it is, working in IE.
But now we’ve created two new problems: The float declaration is causing Firefox to do strange things with the right margin, and Safari’s got a great big horizontal scrollbar.
What’s the answer? Filter IE and give it the slightly modified edition of Jello, and let everyone else have the original.
The Result
Here it is. It starts with the two-negative-margin version, and then adds the float declaration and the left-shift for IE using the star html filter.
Remarks
There’s also elastic design, of course. I haven’t forgotten about that. I just wasn’t sure how to fit it into all this. (Fixed portion in EMs plus percentage, anyone?)
One of the unexpected positive things I realised about this is that there’s an implied min-width cross-browser and without scripting. If you want to put images or flash movies on your site, you can do it without breaking the floats. Simply determine what ‘fixed part’ you want to impose, and then make that the maximum width for your fixed-width content.
I’ve only experimented with this for a few weeks, and I’m a coder more than a designer, but I hope some of the designers out there will find it useful as well.
Mike

Posted at 4:19 am on May 6th by Marcello Cerruti.
Posted at 8:43 am on May 6th by Mike.
Posted at 12:06 pm on May 6th by Christopher Schmitt.
Posted at 1:21 pm on May 6th by clint.
Posted at 2:00 pm on May 6th by Mike Purvis.
Posted at 2:38 pm on May 6th by Joshua Brewer.
Posted at 3:21 pm on May 6th by Tony.
Posted at 5:14 pm on May 6th by Mike Purvis.
Posted at 12:21 am on May 7th by Dan Sauve.
Posted at 6:15 am on May 7th by Marcello Cerruti.
Posted at 4:13 pm on May 7th by Big John.
Posted at 4:36 pm on May 9th by Stu Nicholls.
Posted at 4:52 pm on May 9th by Mike Purvis.
Posted at 7:53 pm on May 9th by Nick Finck.
Posted at 12:12 am on May 10th by Mike Purvis.
Posted at 2:22 am on May 11th by Bob Rackers.
Posted at 9:25 am on May 28th by alexandra.
Posted at 11:29 pm on May 28th by Kevin Barkan.
Posted at 3:51 am on May 31st by Gilles.
Posted at 4:01 am on May 31st by Gilles.
Posted at 4:13 am on May 31st by Gilles.
Posted at 12:36 am on June 4th by Richard Brown.
Posted at 9:40 am on June 4th by jhuls.
Posted at 1:51 am on June 5th by Big John.
Posted at 1:45 am on June 6th by Big John.
Posted at 12:06 pm on June 6th by Mike Purvis.
Posted at 2:10 am on June 10th by Big John.
Posted at 2:50 pm on June 11th by Mike Purvis.
Posted at 3:15 am on July 15th by .bonga.
Posted at 1:47 pm on July 15th by Mike Purvis.
Posted at 11:43 am on July 22nd by .bonga.
Posted at 2:12 am on July 30th by Nick Hope.
Posted at 7:27 am on July 31st by Nick Hope.
Posted at 10:11 pm on August 2nd by Steve Luscher.
Posted at 12:07 am on August 11th by Sa-Appreciative.
Posted at 5:13 pm on August 3rd by marios.
Posted at 9:24 am on October 9th by Rob.
Posted at 9:26 pm on December 11th by wsaspx.
Posted at 9:36 pm on February 1st by Wayne.
Posted at 12:22 am on July 1st by Schmoe.
Posted at 12:37 pm on November 21st by Whatever-ishere.
Posted at 7:43 am on January 13th by sveta.
Posted at 10:15 am on February 19th by DeetaRasphes.
Posted at 11:19 am on April 10th by el factor humano » Archivo » Tamaños de Pantalla, Resolución, Móviles y el Cambio Permanente.
Posted at 12:04 pm on April 27th by LostinJapan » Blog Archive » At the Slouc Cafe Programming, but Sleepy.
Posted at 3:33 am on November 5th by Workaround für min-width bei IE6... - XHTMLforum.
Posted at 8:18 pm on November 11th by flo.