Skip to content

Instantly share code, notes, and snippets.

@mattkruskamp
Last active August 29, 2015 14:01
Show Gist options
  • Save mattkruskamp/7654108fcd60706b3a30 to your computer and use it in GitHub Desktop.
Save mattkruskamp/7654108fcd60706b3a30 to your computer and use it in GitHub Desktop.
Silly things.
/*
Fix for Windows Phone 8 device width bug
*/
@-ms-viewport {
width: device-width;
}
<script type="text/javascript">
(function () {
if ("-ms-user-select" in document.documentElement.style && 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);
}
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment