2014-06-27 63 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>