I want a different a CSS attribute (the overflow) depending if the page is displaying inside a (Facebook) iframe, or on its own.
I know that I can add a bit of Javascript (if (top === window) {...}), but I think a pure CSS solution will be tidier.
So is there any way to make a CSS selector to match only if the page is within an IFrame?
No, there isn’t.
CSS operates on the current document only.