I would like to use media queries to resize elements based on the size of a div element they are in. I cannot use the screen size as the div is jus
div
I've just created a javascript shim to achieve this goal. Take a look if you want, it's a proof-of-concept, but take care: it's a early version and still needs some work.
https://github.com/marcj/css-element-queries