头部HTML出现在页面中

时间:2014-03-13 14:46:13

标签: html ruby-on-rails twitter-bootstrap-3

我正在为=<引用一些外部脚本IE8是这样的:

<!--[if lte IE8]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

然而,在=&lt;中查看我的网站IE8,文件被成功引用,但我可以在页面中的文本<!--[if lte IE8]><![endif]-->,就在正文上方!

这是常见错误吗?代码是我<head></head>中的最后一件事。

这是一个Ruby on Rails应用程序,我正在使用Bootstrap 3 ...

3 个答案:

答案 0 :(得分:1)

尝试更改此内容:

<!--[if lte IE8]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

对此:

<!--[if lte IE 8]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

因为IE8之间没有空格。记得总是在其间放置一个空间。

见这里:http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx

答案 1 :(得分:0)

“IE”和版本号之间需要一个空格,这可能是原因。

答案 2 :(得分:0)

尝试在IE和8之间放置一个空格,同样地:<!--[if lte IE 8]><![endif]-->