Skip to content

Instantly share code, notes, and snippets.

@mazhar266
Last active August 29, 2015 14:04
Show Gist options
  • Save mazhar266/f32178a87e7c58bfa28e to your computer and use it in GitHub Desktop.
Save mazhar266/f32178a87e7c58bfa28e to your computer and use it in GitHub Desktop.
Responsive fix for Windows Mobile 8 (backward compatible)
<!-- beginning of the document -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- rest of the document -->
@-ms-viewport{
width: device-width;
zoom:1.0;
}
@media (max-width: 400px) {
@-ms-viewport {
width: 320px;
}
}
(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);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment