-
200630 Nov
Posted in Modules
The difficulty many developers face when they start moving to table-less sites is getting the layout to work. Floats and positioning are easy enough for basic layouts, but start to become incredibly complex when moving to a more advanced level. When the push to move to pure CSS layouts became intense, the problem was – and is – that tables are still a lot more convenient in many cases, and there is sometimes no decent alternative without contorting yourself; you can’t even use the
display: table
family, as there’s no support in IE.An interesting potential solution is in the CSS3 Advanced Layout module.
It works as so: Imagine you have four list items:
- One
- Two
- Three
- Four
Using the
display
ordisplay-model
declaration, you could lay out your elements in a string as they would appear on screen:ul { display-model: "ab" "cd"; }
And then assign order to the child elements using
position
:li#one { position: a; } li#two { position: b; } li#three { position: c; } li#four { position: d; }
To layout four
li
elements in a square formation, without having to use floats and margins; I’ve replicated the outcome here using a table:One Two Three Four Alternatively, we could use the same four elements for a different layout:
ul { display-model: "aa" "bc" "dd"; }
li#one { position: a; } li#two { position: b; } li#three { position: c; } li#four { position: d; }
I would get:
One Two Three Four Pretty useful, no? It’s much more flexible than the basic examples I’ve shown here, and could save an awful lot of time in the future.
The downside? So far it’s only available as a working draft, and only assigned a medium priority by the W3C. Add on to that the extra time for browsers to implement it, and we won’t be seeing it any time soon.
You can skip to the end and leave a response.
-
Comments
-
01.
I can’t believe that would ever work well. Layouting pages like ASCII-art? relying on indentation of the CSS to be able to use the method properly? I doubt that will stick, but I guess time will tell.
-
02.
Emil: i’m sceptic as well, but some very smart people told me this WOULD be a possibility :)
-
03.
Exec says:Comment » November 30th, 2006 at 12:01 pm
This looks wonderful!
Might be a bit hard to implement in a browser though?@Emil
What do you mean with the part about “relying on indentation”?
Sure, it would be easier to get an overview if you have a lot of elements to position in this way. But you don’t really have to use this to layout a whole page, do you?Anyway, I would prefer the xml implementation instead.
It would be much cleaner. -
04.
It doesn’t rely on indentation, as whitespace in stylesheets is ignored. The example shown here was for the sake of clarity, but the rule is that each string represents a row; “row one” “row two”, etc.
-
05.
I will be very happy if IE in 2016 renders CSS 2.1 right. And all other browsers fix most their CSS related bugs too.
-
06.
Imagine something like
display-model:
{“a.b”
“.c.”
“d.e”;}A code like that would make it pretty easy to add images for rounded borders. While browsing your site I’ve come across lot’s of solutions from design problems we face today. I eagerly await the day all new browser will comply to those new standards.
-
07.
True; although I hope that by the time ‘display-model’ is supported, we have border-radius and border-image to do those functions instead.
-
08.
| martinpulido.com | blog | » Blog Archive » C�mo estructuraremos los websites en 2016 says:Comment » December 5th, 2006 at 1:06 am
[…] Hoy encontr� un art�culo bastante interesante de una de las cosas que se nos trae CSS 3. El art�culo original en ingl�s es de Peter Gasston. Me ha parecido tan interesante que he decidido hacer una traducci�n. […]
-
09.
looks like pretty cool stuff. they should release it now so IE can plan on a 2016 compliance. I think it takes about 10 years for the “MS short bus” to completely understand anything useful.
-
10.
Weblog de Brainet S.L » Archivo del weblog » Enlaces de interés says:Comment » December 9th, 2006 at 8:12 pm
[…] How we´ll layout websites in 2016: ¿podremos llegar a usar esto alguna vez? […]
-
11.
“Layout” isn’t a verb, hence “layouting” also doesn’t exist. “How we’ll lay out Web sites in 2016” (the layouts we will use in 2016).
-
12.
Damn it! That’s been up for a week and I didn’t notice. Changed, thanks.
-
13.
If you’re frustrated by CSS layouts, I strongly suggest trying Yahoo Grids.
http://developer.yahoo.com/yui/grids/
It’s a very flexible way of creating layouts (although it does take skill and isn’t for beginners) and the layouts themselves can be very complex. Best of all, the layouts are all cross-browser tested and they can have flexible widths.
They even use an alphanumeric classification system not too different from the one shown here, although the implementation is not nearly so simple.
-
14.
-
15.
In 2015, Im sure there will be a better way to layout 4 boxes than to use a list item, which is meant for a list. We have adapted so much of the css language to meet our needs, and its funny how people shun tables as being good for tabular data but horrible for layout. I agree that tables bloat code, but lists for layout? Its a hack that works for now, but I would hope in the future there is a tag or something more like tables that works in css like and perhaps.
Thats just my take on the future of css. Why find different ways to adapt current tags, when we should be researching ways to create new tags to fit our coding needs. Am I wrong? Does anyone agree?
-
16.
Peter: I meant that it will still work without indentation but that you won’t be able to read and understand that code then. To “see” the layout as intended you need to have it indented correctly, which I think is being dependent on white-space.
-
17.
Jake, I think you kinda totally completely misunderstood… Who said anything about making a layout with lists? This is just an example of a random element with an ID assigned to it and CSS applied to that element. It might as well have been a division or span :).
If there’s one thing the W3C (especially Sir T-B Lee) is stressing to be most important, it has got to be semantics :).
I think this is a rather complex way of approaching a layout. Especially if we keep in mind that only about 25% of the browsers out there will be supporting it. Imagine the bloaty code and superfluous CSS-sheets for Internet Explorer. I’m actually quite content with the way things are now. All I need to make things work is the little star-hack for IE6. IE7 is only making things more complicated, and CSS3 sure as hell will stri things up like a hurricane through Webdeveloperland.
But I’ll just hold my horses, for now.
-
18.
I dig the concept, don’t fully understand the “need” for it, none the less, interesting.
Lets be totally honest with one another for a second. There’s really only two options for us if we’re still laying out markup / styles by hand in 2016…
A) Career Change
B) SuicideNot to undermine your article Peter, well informed and thought provoking. However, at the rate of the WC3 the sad truth is this will probably be our layout method in 2016.
WC3 should spend a bit less time coming up with lofty ideas that make us all drool, and maybe, I don’t know… use their power to lobby major corporations (adobe/microsoft/etc) so that possibly one day we can have cross browser rendering standards, or even the unthinkable, a GUI that we can actually use to “design” pages rather than limiting use to attribute shortcuts and color coding. (not to say any names, dreamweaver)
Fair and humorous, I totally agree with the choice of title.
cheers
-
19.
@the person above:
That’s a complete Utopia, my friend, not one programme will ever be able to produce code which is as thought-through as when produced by a human being.Though you’re probably right on the time-span we’re talking about here :(.
-
20.
-
21.
I chose 2016 because it’s ten years from now; obviously it’s not a firm date, it was a sly dig at the speed which the W3C and Microsoft introduce innovation.
-
22.
Sounds really dead good this idea.. woo!
i myself find using Frontpage far too restrictive (but dead clever of course), so if i could do things in web talk the same way i might draw say, a dog, on a piece of paper then thats coolio in my book..
er.. but what happens when me mum comes in me room without knocking and im building a prOn site?
-
23.
Wouldn’t you be using :nth-of-type(x) to select your list items, rather than putting an ID on each one?
2016? Hopefully 2008!!
-
24.
josh says:Comment » December 13th, 2006 at 7:49 pm
2016 – because that is how long it will take MS to implement these changes in IE 15.2
-
25.
-
26.
[…] CSS3 . info – » How we’ll lay out websites in 2016 – Weblog (tags: css layout css3 webdesign) […]
-
27.
Azure Concepts Web Development » Blog Archive » Futurists Dream of CSS3 Advanced Layout says:Comment » July 27th, 2007 at 10:52 pm
[…] align=”left” height=”90″ width=”90″ />As Peter Gasston notes over at the CSS3.info site, in the future—and if implementation is any indication, the […]
-
28.
[…] CSS Advanced Layout module (explanation here) has been updated. After a quick read through, I’ve found only a few […]
-
29.
2016? Only browsers left at that time are Safari, Opera, and Mozilla Firefox. IE? It will still be there as “built-in core” of Windows OS, but totally ignored.
No one will use a non-conforming browser like IE when most websites by 2016 are using most (X)HTML and CSS stuff, like what, (X)HTML 7 and CSS3.something?
We all know IE will always be left behind. All IE users will be forced to use a different browser just so they can surf the internet or read their emails.
2016. If IE will not be fixed, it will long be a webdeveloper’s forgotten nightmare.
-
30.
Great article, but as always. IE6 will probably still be alive and we will all have to cater for it because 52% of the market will still decide to make use of it.
I love seeing all this new stuff, but shouldnt everyone be focusing on getting the current browsers to support what’s already out there?
-
31.
[…] Last week saw another layout proposal, the template layout module, reissued as an updated working draft. Previously known as the advanced layout module (and featured in our article How We’ll Lay Out Websites in 2016). […]
-
32.
By 2016, we’ll be able to use rule:
@embed_browser(‘safari, firefox’);
…in our CSS file :)
It does seem rather overkill, and perhaps not all that useful.
I prefer to code markup in xml, and transform it to something useful:ie: ContactJobs
transformed to:
-
33.
My post didn’t take the tags in my example…
ie: <nav><item>Contact</item><item>Jobs</item></nav>
transformed to: <xhtml|pdf|wml|email|wap|sms>
-
34.
What about Flexible Box Layout? It seems nice.
-
35.
[…] from: http://www.css3.info/how-well-layout-websites-in-2016/ Posted in Firefox, Html Css, Internet Explorer, News, Opera, Others, Safari Subscribe to RSS […]
-
36.
[…] to figure out, however, is if the Flexible Box Module is a complement to or replacement for the Advanced Layout Module. Browser support for the latter seems to have stagnated, so I’m guessing the Flexible Module is […]
-
37.
That was the London Web Standards “Pick’n’Mix” meetup | Christian Heilmann's blog – Wait till I come! says:Comment » January 19th, 2011 at 5:55 pm
[…] first to take the stage with a 5 minute lighting talk about CSS layout models. He had written an article with the same title on CSS3.info in 2006 and covered what had improved since then (not much, really). His slides are available on […]
-
38.
SWL-Projekt » That was the London Web Standards “Pick’n’Mix” meetup says:Comment » January 24th, 2011 at 9:32 pm
[…] first to take the stage with a 5 minute lighting talk about CSS layout models. He had written an article with the same title on CSS3.info in 2006 and covered what had improved since then (not much, really). His slides are available on […]
- 39.
-
40.
-
01.