<! - [if!IE]>不工作 [英] <!--[if !IE]> not working

查看:86
本文介绍了<! - [if!IE]>不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题

<!--[if !IE]>

起作用。我想知道是否是因为我在我的文档中有这个

to work. I'm wondering if it is because I have this in my document

<!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
<!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->

当我添加

When I add

<!--[if !IE]><!-->
<link type="text/css" rel="stylesheet" href="/stylesheets/no-ie.css" />
<!--<![endif]-->

到我的标题由于某种原因它不起作用。但是,如果我添加

to my header for some reason it doesn't work. However if I add

<!--[if !IE]><!-->
    <style>
        All my css in here
    </style>
    <!--<![endif]-->

到实际的html页面(标题中)。
有什么建议吗?
干杯

to the actual html page (in the header) it works. Any suggestions? Cheers

更新我的问题

好的,当我删除
<! - > 我只在IE浏览器中检查过,但现在回到FF中,no-ie.css也被应用于FF。所以我加回到<! - > 中,然后删除/(并将其添加到主模板中,以使cms不会将其添加回)和所有的工作都在FF中进行,但现在样式表正在应用于IE!
所以我试过了

Ok, when I removed <!-->I only checked in IE which was working but now back in FF the no-ie.css had been applied to FF too. So I added back in the <!-->and removed the / (and added that into the main template so the cms wouldn't add it back in) and all is working back in FF but now the stylesheet is being applied to IE! So I tried

<!--[if IE]>
<link type="text/css" rel="stylesheet" href="/stylesheets/no-ie.css">
<![endif]-->

<!--[if !IE]> -->
<link type="text/css" rel="stylesheet" href="/stylesheets/no-ie.css">
<!-- <![endif]-->

而这并不奏效。
基本上我试图让这个页面运行 http:// css- tricks.com/examples/ResponsiveTables/responsive.php ,但将CSS移入样式表中。当然这很简单。我错过了什么?如果我不需要,我宁愿不使用JQuery。
干杯

And that didn't work. Basically I'm trying to get this page to work http://css-tricks.com/examples/ResponsiveTables/responsive.php but move the css into a stylesheet. Surely it's got to be simple. What am I missing? I'd rather not use JQuery if I don't have to. Cheers

推荐答案

<!--[if !IE]><!--><script src="zepto.min.js"></script><!--<![endif]-->
<!--[if IE]><script src="jquery-1.7.2.min.js"></script><![endif]-->

注意:这些条件注释不再支持从IE 10开始

这篇关于&lt;! - [if!IE]&gt;不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆