using css media queries with an iframe

为君一笑 提交于 2019-12-11 09:49:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!