JavaScript
Article
By Kevin Yank

CSS Positioning: Three Specs Better than One?

By Kevin Yank
Help us help you! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

One of the areas in which CSS 3 will introduce a lot of new features is page layout. This is widely considered to be a good thing. But with the W3C having just announced that there will be two separate modules for page layout in CSS 3, the standards may be asking too much of browser developers.

Rewarding as it may be to bend CSS’s positioning features to your will, I think we can all agree that CSS 2 was not designed with three-column layouts in mind. Floats and negative margins can get the job done, but they certainly put up a fight.

Introduced by the W3C as a working draft in December 2005, there’s no denying the CSS Advanced Layout module is way better than what we have now, but the apparent lack of interest from browser vendors in implementing this module suggests it might be on the wrong track. Following the release of the latest working draft in August, SitePen’s Alex Russell had some harsh criticism:

--ADVERTISEMENT--

I’m not even sure if the “Advanced” Layouts [module] should be mentioned for the fear that more people might actually look at it. You’d expect an “advanced layouts” module to give us hbox and vbox behaviors or a grid layout model or stretching … but no, the “answer” apparently is ascii art.

It seems at least some members of the W3C CSS Working Group agree. Last month, the group released the first public working draft of another CSS 3 module for layout: CSS Grid Positioning.

This new layout module builds on the existing Multi-column Layout module for text columns, which saw its latest working draft in June, and which is now partially supported by Firefox 2 and Safari 3. Grid Positioning enables you to align elements to an ‘implicit grid’ defined by a multi-column element. Alternatively, you can define an ‘explicit grid’ and then align elements to that. This works by introducing a new CSS length measurement: the grid unit (e.g. 1.5gr).

The interaction between the Advanced Layout module and the Grid Positioning module remains to be specified, but it’s expected that an element that defines a positioning grid using the Advanced Layout module will also define an implicit grid for aligning elements with the features of Grid Positioning.

All this sounds great, but will we ever be able to use any of it? Even relatively adventurous browsers like Opera and Safari have steered clear of the Advanced Layout module so far, and while Grid Positioning does build on features that are getting browser support, this new layout module looks no easier to implement.

At a time when the biggest challenge for CSS is getting browser makers to invest in new features, should the W3C be watering down its ‘sales pitch’ with multiple CSS modules for doing the same thing? Or is it a good thing for the W3C to keep proposing new CSS layout standards until the browsers take an interest in one of them?

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the latest in JavaScript, once a week, for free.