The following site is fully responsive when accessed directly:
However, when accessed through an iframe, its responsiveness misbehaves and does not conform to the width of the browser:
iframe {
display: block; /* iframes are inline by default */
border: none; /* Reset default border */
height: 100vh; /* Viewport-relative units */
width: 100vw; /* Viewport-relative units */
}
<div class="iframeContainer">
<iframe src="https://prosolutionplus.com/">
</iframe>
</div>
https://jsfiddle.net/g2eupd80/
I've tried every iframe responsive solution I could find (including the one above that actually works with other responsive sites), but nothing worked on this particular site. I noticed that when accessed via an iframe, the target site is setting a width of 1093px, but it does not do that when accessed directly and is then resized, so that's probably why the different solutions I've tried are not working. In other words, the target site is behaving differently depending on whether it is being accessed by the browser directly or via an iframe.
For it to be doing that, the target site is obviously detecting something differently when accessed via an iframe than it does when accessed directly, I just don't know what that is.
How can I fix this so that the iframe is treated just like a browser so that the target site behaves responsively within the iframe?
Compare the above JSFiddle example which is responsive when accessed directly but NOT when accessed via an iframe, to the example below which is responsive when accessed both directly and via an iframe. The only difference in the code is the URL.
iframe {
display: block; /* iframes are inline by default */
border: none; /* Reset default border */
height: 100vh; /* Viewport-relative units */
width: 100vw; /* Viewport-relative units */
}
<div class="iframeContainer">
<iframe src="https://www.vigrxplus.com/">
</iframe>
</div>