Responsive Design in Internet Explorer 10 / Windows 8

By David Marland
· 430 words ( )

Reading speed

Don't know your reading speed?
Start a timer while reading this post. When finished, stop the timer to find your reading speed.

UPDATE 17/01/2013: Adding the piece of CSS recommended in this article will break responsive pages on the latest Windows Phone 8 with IE 10.0. It is recommended not to use this “fix” until that bug has been sorted. Follow this thread for more information.

You’re probably well aware of responsive web design; a principle where you no longer build your website to a fixed 960 pixels wide, but allow it to adapt and flex to fit wherever it happens to be.

There is a massive range of screen sizes from phone to smart phone to tablet to desktop and even black and white devices like the Amazon Kindle. Each of these comes with their own set of challenges but it looks like there is a new kid coming up on the block.

Windows 8 Start screen

Windows 8 offers a radically new desktop/tablet experience and will support a range of hardware devices. Application developers for windows 8 will need to be aware of scaling for different screens.

Note: At the time of writing Windows 8 is still in Consumer preview so any of this is subject to change before general release.

Internet Explorer 10

In testing Internet Explorer 10 on Windows 8 I noticed that when you snap a site to the side the page was simply zooming out making it unreadable. It was quite a challenge to discover why but it appears that Internet Explorer 10 zooms the page out when the width is less than 1024px. This may also affect portrait orientation but I am unable to confirm at present as I have the preview on my standard laptop.

This effect is irritating for those who spent a fair bit of time and effort working on their responsively designed pages. You can see the effect on this demo page. A picture of what happens is shown below:

Screenshot 1

Excuse the photograph; I couldn’t get a screenshot in Windows 8 + Mac keyboard.

The site on the left is zoomed out and unusable.

Solution

As I discovered buried in the device adaptation page there is a simple solution that tells Internet Explorer 10 to disable its automatic scaling and adhere to your responsive designs. Simply add the following to your CSS file:

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

You can see this in action in the second demo page. The change has produced the desired effect in a snapped window (on the left):

Screenshot 2

Update: necolas makes a good point that it is not optimal to have to do this and it should be considered an IE10 bug. Further discussion here

Stop reading timer

Elapsed time: 00:00:00

© 2011 - 2026 hammerspace.co.uk / Piko design system / Admin

The opinions expressed on this site are my own and do not necessarily reflect the views of my employers, past or present.

Look Ma, no cookie banner. Anything stored in your browser is purely functional. No information is stored about you or shared with anyone. Your IP address may be used to estimate your location to see which regions generate the most traffic, but is not stored after that estimation. A cookie may be set to prevent double counting of page views, but is not used for tracking (which is acceptable without a cookie banner under the UK's DUAA and EU Digital Omnibus Package).
This site is proxied via Cloudflare, which may collect some information about your visit. See Cloudflare's privacy policy.