Example Markup:
Trigger
This is some content
Shiny new CSS flexbox technology makes this a bit easier, but the downside is the actual content will be reversed. This doesn't have to be a big problem, it's just semantically weird.
In short: wrap everything in a container with these styles:
display: flex;
flex-direction: column-reverse;
See the fiddles for a working example (hover over the wrapper elements to see the action).
It's useful if you don't want to rely on javascript to dynamically check z-indexes every time you update the content. If the This is your current setup:
http://jsfiddle.net/dJc8N/2/ And this is the same HTML, with added CSS (notice the numbers in the EDIT: The CSS I posted is probably not ready to be copy-pasted yet. This, however, is: tags):
http://jsfiddle.net/Mjp7S/1/display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
-webkit-flex-direction: column-reverse;
-moz-flex-direction: column-reverse;
-ms-flex-direction: column-reverse;
-o-flex-direction: column-reverse;
flex-direction: column-reverse;