I'm sure this "grid.css" is great, really concise, etc. But do we really need to be using it? I like to type out comments on HN and never hit "add comment," today I will.
I saw a great talk by Nicole Sullivan on CSS last week. She said that many sites lack a meaningful high-level abstraction for their visual layout, and end up with a tangled mess of float, padding & margin declarations on every element. This complexity, she said, is more clearly and concisely handled at a higher, site-wide level and suggested using a grid.
I've wasted an insane amount of time pushing one element four pixels this way and another element three pixels that way, so I'm definitely eager to try a grid on my next project.
Links to her slides (with some other great info) and her grid framework:
http://www.slideshare.net/stubbornella/our-best-practices-ar... https://github.com/stubbornella/oocss/blob/master/core/grid/...
So I agree with Breefield that it's not optimal to have separate class definitions outside of your high level semantic abstraction for the sole purpose of layout. But I don't know of any other way to do it other than just building the grid into your abstraction, which means you can't reuse existing css layout systems (unless you just copy the code... ick...).
Using that you can still think of things in a logical grid format rather than pure CSS (i.e. 3 columns wide, rather than 80px), but keep your HTML clean.
See the "semantic_classes" option: http://joshuaclayton.me/blueprints_compress_a_walkthrough.ht...
Not to mention if you use Compass you can do the same thing with their Blueprint mixins: http://compass-style.org/reference/blueprint/grid/
Or if you use Less: https://github.com/omnifroodle/blueprint.less
In saying that, it's easier to shove a bunch of classes into your html, and that's kind of what the multipurpose class tag is for. As to whether the binding should be done via css selectors or via html classes... well, I think the appropriate phrase is "6 of one, half a dozen of the other".
I've done most things both ways at some stage or another, and the maintenance is the same, the complexity is the same, and there's an advantage to having a label directly on the html node, that tells you what the hell is being applied to it.
Grid systems are great, but not in the way they're being used today - with lots presentational of classes and ids in the markup.
Are we going back to the days of tables for layout? Look, classes like span-x, grid-y, append-x describe only the presentation of the content. I thought HTML was meant to describe structure, not layout.
Grid systems are destroying the semantic web.
EDIT:
Other classes-littered systems aren't any better (OOCSS, I'm looking at you).
I found that you can select (and therefore copy) all text in a paragraph in one grid, while keeping the text in another paragraph unselected. While this doesn't have any immediately obvious uses to me, there is still some merit.
Screenshot: http://i.imgur.com/uycBt.png
Not if you're using Compass with its mixins: http://compass-style.org/examples/blueprint/grid/two_cols/
I love using a grid, but it serves a purpose for me, and I do it all in the CSS without creating a dozen of "clearfix" and "column1" classes and whatnot.
1) the development time / potential number of users ratio is attractive for a developer (easy 100+ watchers on github etc) 2) many people have built their own grid system over the years and feel like sharing them, documenting it and putting it on github isn't hard.
Here's a pretty good summary: http://stackoverflow.com/questions/83073/why-not-use-tables-...
The only argument that might be important against tables that I could see is that they work less well with screenreaders. Can anyone using a screen reader confirm or deny this? I could easily see it being the other way around, because with tables a screen reader will let you quickly navigate to different parts of the page (e.g. sidebar to header to main content by going left, right, up and down instead of painstakingly navigating over a bunch of text).
On the other hand, tables are easier to use, more flexible, more predictable across browsers, and more readable. Just look at the years and years of research it took the CSS experts at e.g. Alistapart to replicate layouts that are trivial with tables using CSS.
Examples:
http://www.alistapart.com/articles/fauxcolumns/
http://www.alistapart.com/articles/fauxabsolutepositioning/
http://www.alistapart.com/articles/multicolumnlayouts/
http://www.alistapart.com/articles/negativemargins/
And even then it doesn't always work: http://www.satzansatz.de/cssd/hgjump.html
Note that these layouts are utterly trivial to create with tables.
Otherwise, yup... it's a grid. Looks like they're setting the grid elements to display:inline... which seems weird and unnecessary to me? Block elements don't belong inside inline elements.
I hate to keep posting this, but I've been unable to find fault with this grid [https://github.com/stubbornella/oocss/blob/master/core/grid/...] code. .lastUnit spans the pixel gap on the rightmost, nestable, extendable, fluid widths.
The two are mostly the same idea, but I think the OOCSS project implements it better and works with more browsers.
http://www.positioniseverything.net/explorer/doubled-margin....
CSS defines style, HTML defines the semantics. The semantics of a div or an h1 don't change if you declare them inline in your CSS. So there is nothing wrong putting inline elements (styled as block) inside block elements.
HTML5 blurs this further as you can now wrap pretty much anything with <a>.
I'm to blame about display:inline in Malo that is actually wrong it should be *display:inline or even better _display:inline to resolve the double margin problem in IE6.
It amazes me how, with so many existing grids that do it right, someone can write one that's wrong. Or would bother to in the first place.
I agree with huckfinnaafb - OOCSS is better implemented if you want a simple grid
I wrote up an example here: http://monkeyandcrow.com/blog/splitting_the_difference/
Blueprint type grids(http://www.blueprintcss.org/), OOCSS/YUI2 (https://github.com/stubbornella/oocss/wiki), and YUI3 (http://developer.yahoo.com/yui/3/cssgrids/).
Why create new grids, lets make the old ones better, or explore new uses for them. Like many on this post I can't imagine there are very many good ways to go about this.