简体   繁体   English

条件格式标签在IE8中不起作用

[英]Conditional formatting tags not working in IE8

I am currently working on a web development where I am now doing my formatting to please IE 8 or newer. 我目前正在进行Web开发,现在正在进行格式化以取悦IE 8或更新版本。 I have done this for previous browser versions, but not ie8. 我已经为以前的浏览器版本做过这个,但不是ie8。 My issue is that my conditional formatting tags are no longer working for this version of IE. 我的问题是我的条件格式标签不再适用于此版本的IE。 Has something changed? 有什么变化?

page: http://domain/includes/file.php page: http://domain/includes/file.php

css file: http://domain/css/cssIE8.css css文件: http://domain/css/cssIE8.css

the tag in my page is as follows: 我页面中的标签如下:

    <!-- [if gte IE 7]>
    <p>Show this in IE</p>
    <link href="../css/profileIE8.css" rel="stylesheet" type="text/css" />
    <![endif]-->

When I remove the conditional formatting tags, all the other browsers find the file just fine. 当我删除条件格式标签时,所有其他浏览器都可以找到该文件。 Any thoughts? 有什么想法吗?

I even placed the <p> tag in there to see if it would display in the page, it doesn't. 我甚至将<p>标签放在那里以查看它是否会显示在页面中,但事实并非如此。 My understanding is that this specific conditional formatting tag would apply to all Internet Explorer versions NEWER than v7 我的理解是这个特定的条件格式标签将适用于比v7更新的所有Internet Explorer版本

The space between <!-- [if.. should be removed. <!-- [if..之间的空格应该删除。 Hope it helps! 希望能帮助到你!

<!--[if gte IE 7]>
    <p>Show this in IE</p>
    <link href="../css/profileIE8.css" rel="stylesheet" type="text/css" />
    <![endif]-->

More info can be found here: http://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx 更多信息可以在这里找到: http//msdn.microsoft.com/en-us/library/ms537509(v = vs.85).aspx

You state: 你说:

When I remove the conditional formatting tags, all the other browsers find the file just fine. 当我删除条件格式标签时,所有其他浏览器都可以找到该文件。 Any thoughts? 有什么想法吗?

Not sure how that is true, as your href is ../css/profileIE8.css , but the file path you gave as your css is http://domain/css/cssIE8.css so the file names are different . 不确定这是怎么回事,因为你的href../css/profileIE8.css ,但你给你的css的文件路径是http://domain/css/cssIE8.css所以文件名是不同的 Unless you mistyped one here, your href does not match your file path, and thus it is not finding the css file. 除非你在这里输入错误,否则你的href与你的文件路径不匹配,因此它找不到css文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM