Mobile site not rendering mobile within iframe

Posted by user2788371 on Stack Overflow See other posts from Stack Overflow or by user2788371
Published on 2014-06-02T03:20:40Z Indexed on 2014/06/02 3:25 UTC
Read the original article Hit count: 123

Filed under:
|
|
|

I'm launching a mobile version of an existing corporate web application that currently loads in an iframe for corporate authentication purposes. When accessing the web app's direct link from a mobile device, it displays beautifully. The problem is that when accessing through the iframe, the site doesn't seem to scale correctly and it looks more like I'm accessing the desktop version of the site. Any suggestions on how make the site within the iframe recognize the mobile device's width and adjust appropriately? I've tried setting the viewport within the HTML and CSS of the site being loaded and even then I'm not getting the change I expect on my iPhone. I haven't had the opportunity to test an Android yet but within our company, iOS is the most important. Some of snippets of code I have tried are listed below. I've also tried 480px and device-width (which I believe I can't access because the iframe is a different domain).

Unfortunately, modifying the iframe page and settings are not an option. Also, Javascript cannot be used as a solution for other reasons.

Within HTML of web app site:

<meta name="viewport" content="width=320px, initial-scale=1.0, user-scalable=no" />

Within CSS of web app site:

@viewport
{
   width: 320px;
}

The above CSS does not seem to render even when not used in device specific @media code.

© Stack Overflow or respective owner

Related posts about ios

Related posts about css