1
The Holy Grail Layout in CSS, is a full height, 3 column layout which consists of a fluid central column, and two side columns with fixed widths.
Your Task is Simple!
Reverse it, make a fixed width central column, and two fluid width columns to the sides. The point is for them to take All available space both vertically and horizontally. So if one adds elements above, or elements below (assume 100% width), your solution should shrink to accommodate. Same goes with elements on the sides. Your layout should fill 100% of its container's space.
Restrictions
- HTML and CSS only (no JavaScript)
- IE8+ support mandatory
- Must work in all major browsers (it is, after all, a layout!)
- HTML and CSS must both be valid.
- No tables, it's supposed to be a layout, not an abomination.
Winner
- Code with fewest characters wins, excess spaces and newlines do not count, don't be afraid to be readable! (I'm running the solution through a minifier)
Good luck!
2
The specification is a bit vague, but on the assumption that it can be tightened up, how would you pick a winner between two solutions? All questions on this site should have an objective primary winning criterion.
– Peter Taylor – 2013-09-07T22:06:05.013Well, with the lack of a better criterion, I'd say it would be shortest code possible. I'll edit it as soon as I get to a PC. – Madara's Ghost – 2013-09-08T04:31:38.797
How about providing a list of browsers to support, then score by the following? [code size] / [number of actually supported browsers] – Hand-E-Food – 2013-09-08T22:15:29.303
1I think the current attempt at an answer validates my comment that the specification is a bit vague. Can you give a precise definition of what counts as a "column"? – Peter Taylor – 2013-09-09T08:46:44.667
@PeterTaylor As always: Proof by example. I don't know yet if this is counter productive or not. – Johannes Kuhn – 2013-09-09T08:53:02.340
I will update the criteria when I get to a PC later today. – Madara's Ghost – 2013-09-09T10:19:50.240
Edited to make clear (tell me if you still need more information). Sorry for those whose solutions were invalidated. (My first puzzle on this site :D) – Madara's Ghost – 2013-09-09T15:15:16.003