سؤال

I'm trying to test a website on IE8, While i don't have IE8 on my computer i use Developer tools (f12) and document mode to imitate IE8, But it doesn't work, The browser isn't loading the alternative CSS file.

هل كانت مفيدة؟

المحلول

Conditional comments do not work in IE 11, even when using compatibility mode. If you need to test CSS for outdated versions of IE you really need to download a free VM from http://modern.ie. There are 90 to choose from so there should be one you can run locally or in the cloud.

نصائح أخرى

In the comments you specify that you have the following conditional CSS:

<!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="ie7-and-down.css" /> <![endif]-->

If this is your actual line, then it's normal your CSS is not loaded, since it's specific for any version below IE8.

IE should load the appropriate styles when you set the document mode.

The Developer tools aren't the best to test websites, because the developer toolbar imitates the wanted, but uses its own agent & JS to make the pages work.

For me the solution is to setup some VM's (virtual machines http://www.vmware.com/eu/) for each browser, to be sure to have the wanted browser in real behaviour, or use something like http://www.browserstack.com/

But, I agree that debugging JS in a IE7 is quite harmful without any tools, I tried many of them, but none to advice! So conclusion, VM's

Also, in IE8 it's the same problem: The toolbar is much better than in IE7 but it's stil not made for developers...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top