使用带有iframe的css媒体查询 [英] using css media queries with an iframe

查看:363
本文介绍了使用带有iframe的css媒体查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个加载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.

推荐答案

除非我非常错误,否则您对 CSS的iframe内容几乎没有'外部'控制。我想你很幸运。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆