Windows Phone 8 IE10 Mobile Fix - IE (Internet Explorer) | UA - User Agents

Standards Based Development

Steps

css


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

html


<meta name="viewport" content="width=device-width, initial-scale=1" />

JavaScript


<script>
(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>

Windows Phone 8 ie10 Fix - specifically targetting ie Mobile 10.0; conditional ensuring this only occurs in ie for future versioning.

Note: JavaScript cannot be disabled on Windows Phone 8, and in such this script will always be effective.

References and Resources