Today I wish for CSS gravity. With CSS gavity I could create a box and then tell an element if and how gravity affects it. An element with gravity of 2 would fall to the bottom of the box, below anything with a gravity of 1 or 0 (zero gravity is what happens already, content flow starts at the top and works down). An element of gravity 3 would always fall beneath my gravity 2 element. And so on.
The many reasons why this would never be implemented by the W3C is left as a research excercise for the reader.
«3 CommentsMay 24, MMV»
You've arrived at the homepage of Stephen Stewart. The archive is available here for those who want it. This site is happily hosted by Dreamhost. Click for more?
More!? OK then, but I can't help feeling that this will be a disappointment to you.
I work as a web designer in Belfast, and I live by the sea in a shoe. You can see me here, doing my livejournal pose as idoru called it. If you need to you can email me at carisenda -at- gmail -dot- com.
Is this not z-index?
Of course it works the other way around with higher number being displayed above lower numbers.
Nope. I’m talking about a y-index, the vertical component. The horizontal positioning (x-index) has some rudimentary control in floats, z-index provides fine grained stacking control and a y-index (or gravity) would provide fine grained vertical control.
So if I create a 500px high box and tell a p tag with a class of “page_number” that it has a gravity (or y-index) higher than all else, it will always appear at the bottom of that box.
Ah right. Now that makes sort of sense. I won’t get into a discussion on putting the contents in the order you want them as I’m sure you know what you’re doing.