2014-06-27 64 views
0

我有一个iframe来显示.htm文件的内容,该文件存在于另一个位置。该文档在桌面浏览器上完美加载。响应IFrame显示来自外部文档的内容

但是,在移动版本上,文档的内容并未完全显示。

我正在寻找适用于移动和桌面视图的响应式iframe。

HTML

<iframe 
    id="ifrm" 
    src="URL.htm" 
    width="100%" 
    frameborder="0" 
    scrolling="no" 
    height="1450px" 
    style="padding-top: 0px; float: left;" target="_blank" 
/> 

我提到这些链接,但遗憾的是他们并没有帮助:

Full-screen iframe with a height of 100%

Scale iFrame css width 100% like an image

+0

目标页面是否响应? – TribalChief

+0

是的。该页面是响应式的 – Sandeep

回答

0

尝试这样LINK

HTML:

<div class="iframe"> 
    <iframe src="http://a.rgbimg.com/cache1wZTwK/users/m/mi/micromoth/600/oIejAt8.jpg" frameborder="0"></iframe> 
</div> 

CSS:

.iframe { 
    position:relative; 
} 
iframe, object, embed { 
    max-width: 100%; 
    min-width: 100%; 
} 
0

Demo在iframe中引导网站

请确保您有

<meta name="viewport" content="width=device-width, initial-scale=1" /> 

在您的文档的<head>