0

I have an iframe to display the content of a .htm file, which is present in another location. The document loads perfectly while on a desktop browser.

But while on a mobile version, the content of the document is not displayed completely.

I am looking for a responsive iframe for both mobile and desktop views.

HTML

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

I referred these links, but unfortunately they didn't help:

Full-screen iframe with a height of 100%

Scale iFrame css width 100% like an image

Community
  • 1
  • 1
Sandeep
  • 26
  • 1
  • 5

2 Answers2

0

Demo with bootstrap website in iframe

Make sure you have

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

in <head> of your document.

4dgaurav
  • 11,360
  • 4
  • 32
  • 59
-1

Try like this 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%;
}
G.L.P
  • 7,119
  • 5
  • 25
  • 41