Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

@-ms-viewport rule doesn't work in WP8 IE10 #62

Open
stowball opened this issue Jan 8, 2013 · 1 comment
Open

@-ms-viewport rule doesn't work in WP8 IE10 #62

stowball opened this issue Jan 8, 2013 · 1 comment

Comments

@stowball
Copy link

stowball commented Jan 8, 2013

I've written a post explaining that it doesn't work here: http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html

You need to use this instead:

@media (max-width: 400px) { /* or 25em to be "responsibly responsive" */
    @-ms-viewport {
        width: 320px;
    }
}
@stowball
Copy link
Author

Microsoft have offered a solution to the viewport bug. I've described it here: http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html#update-2013015

Basically, they want us to continue using

@-ms-viewport{
    width: device-width;
}

and then using a script immediately after the CSS to modify the viewport for IE 10.0 only

if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
    var msViewportStyle = document.createElement("style");
    msViewportStyle.appendChild(
        document.createTextNode("@-ms-viewport{width:auto!important}")
    );
    document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant