h5bp / html5-boilerplate

A professional front-end template for building fast, robust, and adaptable web apps or sites.
https://html5boilerplate.com/
MIT License
56.45k stars 12.23k forks source link

Media Queries not working in IE8 #865

Closed AndrejVasso closed 12 years ago

AndrejVasso commented 12 years ago

I am using the Boilerplate 2.0 and I have noticed that the media queries are not working in IE8. (although the Modernizr script includes respond.js)

To make sure its not related to my code, I have tested it on http://html5boilerplate.com/ too:

In FF, Chrome and IE9, the content resizes depending on the current browser window size.

However, in IE8 (and below) the custom media styles are applied by default and the site looks like the smallest version possible. No matter how big/small the browser window is.

After a initial question on StackOverflow, I noticed I am not the only one having problems with it and so I figured out its not something related only to myself. I did also test it in "IE Tester" with the same results.

necolas commented 12 years ago

This sounds like the recurring problem with Respond.js or the version included in 2.0. We're looking at removing Respond.js from the next release. Please try upgrading the custom build of Modernizr or using the latest version of Respond.js from its GitHub repository (and let us know if that helps resolve the issue). Thanks!

AlecRust commented 12 years ago

I can confirm this issue in IE8 with Respond.js that comes with Modernizr, and also confirm including the latest version of it separately solves the problem.

paulirish commented 12 years ago

We're going to remove respond.js. We no longer advocate for its use. You can do responsive CSS without using it and we recommend that now. :)

AlecRust commented 12 years ago

Whilst still bringing Media Queries support to IE?! Would you mind sharing a link?

paulirish commented 12 years ago

https://github.com/h5bp/html5-boilerplate/issues/816#issuecomment-2512805

http://zomigi.com/blog/essential-considerations-for-crafting-quality-media-queries/

necolas commented 12 years ago

@alecrust No, there is no way to make IE support MQs without using a polyfill like Respond. Providing IE users with min/max-width MQ support isn't a high priority because:

  1. the browser doesn't provide it by default, so...
  2. users do not expect it and do not get it from overwhelming majority of the websites they browse.
  3. css polyfills result in an already-old browser with an already-slow JS engine receiving an additional performance penalty.
  4. the main concern with IE is delivering a "desktop" experience, not with providing MQ support.