CSS - move-to directive to change the order of elements

Usually you cannot re-order elements with pure CSS. It's a commonly asked question (e.g. a stackoverflow question, another stackoverflow question). The usual response is to use Javascript to manipulate the DOM.

This always sorta annoyed me. I thought there should be some way to re-order elements using pure CSS.

CSS3's move-to and pending

I think it's possible to do this with move-to in CSS3's Generated and Replaced Content Module (this is the thing that gives us the content rule which allows us to add in new content).

Example

I've tried making a simple example of move-to, however it doesn't work in Chromium or Firefox, and the excellent QuirksMode doesn't have move-to in the CSS compatability tables.

External links

This entry is tagged: