问题
I have a page that loads an iFrame (fancybox). My CSS media queries work fine on the parent pages but when the content is called within the iFrame, the media queries don't work. (the content within the iFrame has it's own stylesheet).
How do i get the media queries to work within the iFrame? FYI - My width and height is being set by the javascript that calls 'fancybox' which creates the iFrame and is set using percentages.
回答1:
Unless I'm very much mistaken, you have very little 'outside' control over the contents of an iframe with your CSS. I think you're kind of out of luck.
来源:https://stackoverflow.com/questions/12185073/using-css-media-queries-with-an-iframe