使用带有iframe的css媒体查询 [英] using css media queries with an iframe
问题描述
我有一个加载iFrame(fancybox)的页面。我的CSS媒体查询在父页面上正常工作,但是当内容在iFrame中调用时,媒体查询不工作。 (iFrame中的内容有它自己的样式表)。
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).
如何获得媒体查询在iFrame中工作?
FYI - 我的宽度和高度由javascript调用'fancybox',它创建iFrame并使用百分比设置。
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.
推荐答案
除非我非常错误,否则您对
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.
这篇关于使用带有iframe的css媒体查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!