Green

CSS Gravity

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»

Reader Comments

Steve said on Wed 25 May at 09:57:

Is this not z-index?

Of course it works the other way around with higher number being displayed above lower numbers.

stephen said on Wed 25 May at 10:18:

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.

Steve said on Wed 25 May at 10:22:

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.


Name:

Email:

URL (optional):

What colour is an orange?:

Comment (comments use Textile formatting):

About This

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.

My hCard

Stephen Stewart
Donaghadee , County Down Northern Ireland

Recent Comments


Recommended Viewing

  • 300rating
    Does exactly what it says on the (comic book) tin. Loved it.
  • Little Miss Sunshinerating
    Very funny, disturbing (the beauty pageant) and completely messed up -- but in a good way.
  • Laputa: Castle in the Skyrating
    Story great, characterization a little on the weak side -- though the big robots are cool.
  • Porco Rossorating
    Stylish, funny, exciting.
  • Grave of the Firefliesrating
    Very sad, which was a little unexpected since I didn't know much about it before watching it. Can be a little too slow in places though, otherwise it's very good.
  • Nausicaä of the Valley of the Windrating
    The story can get a little dense at times what with the various factions, but still really enjoyable, inventive and engaging.
  • X-Men: The Last Standrating
    Opportunity, talent, money - all blown. Over 3 films X-Men has hinted of something great that could have been, this last one says "No, sorry - not going to happen". Bah.

flickr.com


Main Atom Feed, Photoblog Atom Feed, Linkblog Atom Feed, Technorati Profile
Powered by Movable Type 3.34. Design © Stephen Stewart. Happily hosted by Dreamhost.