IE 注释根本不渲染页面上的 css
这是我的网站,它在 chrome、firefox 和 IE 9 上运行良好。当我在 IE 7 和 IE 9 上尝试时,它运行良好。 IE 8 我用于 css 的 IE 注释根本不显示。我的网站:http://www.chan-leung.com
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/ieHacks.css" type="text/css" media="screen, projection" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="css/ieHacks7.css" type="text/css" media="screen, projection" />
<![endif]-->
css文件在本地工作正常,但是当我上传到我的主机,CSS 不显示。我正在使用 IE 调试器进行浏览器测试(针对 IE)。 IE 的 F12 键。当我尝试查找 ieHacks.css & ieHacks7.css,没有显示任何内容。我不知道 ie 评论不起作用的原因是什么。
任何帮助或建议将不胜感激。
This is my website, it works fine on chrome, firefox and IE 9. When i try it on IE 7 & IE 8 the IE comments that I use for css is not showing at all. My website: http://www.chan-leung.com
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/ieHacks.css" type="text/css" media="screen, projection" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="css/ieHacks7.css" type="text/css" media="screen, projection" />
<![endif]-->
The css files works fine locally, but when i upload to my hosting, the css doesn't show. I'm using IE debugger for browser testing (for IE). The F12 key for IE. When i try to look up ieHacks.css & ieHacks7.css, nothing is showing. I'm stump as to what would be the reason why the ie comments is not working.
Any help or suggestion would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您的 css 文件命名不正确?
您的网站可能正在尝试使用 css/ieHacks.css 和 css/ieHacks7.css 但实际文件是 css/iehacks.css 和 css/iehacks7.css
也尝试使用绝对网址,看看它是否有区别,例如:
另外,请注意,您首先要做一个更一般的作业,然后再做一个更具体的作业,这是有意的吗?第一个 css 文件以及第二个更具体的文件将应用于 ie7。
更新:
您的网站 CSS 似乎如下所示,这与您在问题中所说的不同:
Perhaps you have names the css files incorrectly?
You site is maybe trying to use css/ieHacks.css and css/ieHacks7.css but the actual files are css/iehacks.css and css/iehacks7.css
Also try using absolute urls and see if it makes a difference e.g:
Also, just a note, you are doing a more general assignment first and another more specfic one second, was this intended? The first css file will be applied to ie7 as well as the second, more specific one.
UPDATE:
Your site css seems to be the following which isn't like you said in your question: