如果IE语句不起作用

如果IE语句不起作用

本文介绍了如果IE语句不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! <! - [if lt IE 7]> < html class =ie ie6 lte9 lte8 lte7>百分比抑制率ENDIF] - GT!; <! - [if IE 7]> < html class =ie iel lte9 lte8 lte7>百分比抑制率ENDIF] - GT!; <! - [if IE 8]> < html class =ie ie8 lte9 lte8>百分比抑制率ENDIF] - GT!; <! - [if IE 9]> < html class =ie ie9 lte9>百分比抑制率ENDIF] - GT!; <! - [if gt IE 9]> < HTML>百分比抑制率ENDIF] - GT!; <! - [if!IE]><! - > < HTML> <! - <![ENDIF] - GT; 上面的代码似乎并没有起作用。 我的网站唯一的IE版本(兰迪)似乎工作在IE9。我认为这是有效的,因为我上面输入了条件语句,但它在IE9中也没有这些语句。如果我在IE8和IE7中查看它,我会看到一个破碎的网站。任何帮助将得到最多的赞赏。解决方案 IE 10不支持条件注释,无论如何都不是好主意, 您应始终使用功能检测代替浏览器检测。 'p>编辑:读控制台也有帮助: <!--[if lt IE 7]> <html class="ie ie6 lte9 lte8 lte7"> <![endif]--><!--[if IE 7]> <html class="ie ie7 lte9 lte8 lte7"> <![endif]--><!--[if IE 8]> <html class="ie ie8 lte9 lte8"> <![endif]--><!--[if IE 9]> <html class="ie ie9 lte9"> <![endif]--><!--[if gt IE 9]> <html> <![endif]--><!--[if !IE]><!--> <html> <!--<![endif]-->The above code, does not seem to work in the least bit.The only IE version that my website(The Randy) seems to work in is IE9. I thought it was working because of the conditional statements I've input above, but it works in IE9 without those statements as well. If I look at it in IE8 and IE7 I get a broken looking website. Any help would be most appreciated. 解决方案 Conditional comments are not supported in IE 10 and are a bad idea anyway, especially since standards have been set.You should ALWAYS use feature detection instead of browser detection.EDIT: Reading the Console helps too: 这篇关于如果IE语句不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 16:36