htmlcssmobile-chrome

Website loses mobile-friendliness when loaded in frame


I have a page on my website in which I'm loading a purpose-built WIX marketing site inside a frame thusly:

<html><frameset cols='100%'><frame src='https://michael3557.wixsite.com/truckercert'></frameset></html>

On a pc/laptop, everything looks fine and as expected. But on a phone, the "mobile-friendliness" of the wix page is gone, and a super-narrow, unfriendly page displays.

Yet if you hit the wix link shown above directly (not inside a frame) on a phone's browser, it does look fine and mobile-friendly.

Why does my page lose its mobile-friendly nature just because it's loaded inside a frame? And how can I solve this?


Solution

  • The browser determines the viewport settings from the top-level document.

    The frame HTML has no <meta> tag setting the viewport.

    The page inside the frame is not the top-level document so its <meta> viewport data is ignored.