HTML 5 Boilerplate - Issues with IE?

天涯浪子 提交于 2019-12-08 08:59:50

问题


I usually code all website projects by scratch but I decided to use boilerplate for a new project after checking out the source code etc...

The set-up is great and the code is solid but I am having problems with IE that I may just be overlooking but I can't seem to solve the issue. Basically, the site displays perfect on every browser and phones etc but will not display anything for IE... The only thing that IE displays is the body background??

Basically because I can't post the website because of the client (they are quite high profile where I am from) I am just checking if this is a common problem?? Is there a quick fix??

I know I'm not giving much information I'm just looking to see if this is a common fix or if it's something I'll have to look into...

Thanks for any help!

EDIT - Here is my doc head:

<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <title></title>
    <meta name="description" content="">
    <meta name="author" content="">

    <meta name="viewport" content="width=device-width,initial-scale=1">

    <link rel="stylesheet" href="css/style.css">

    <script src="js/libs/modernizr-2.0.min.js"></script>
    <script src="js/libs/respond.min.js"></script>

    <script type="text/javascript" src="http://use.typekit.com/lyx5qmg.js"></script>
    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
</head>

回答1:


On google's site at: (dead link) https://code.google.com/p/html5shiv/issues/detail?id=24# it says the problem is with the url. A gentleman named Richard Bland indicated a correction:

!--[if lt IE 9]>
<script src=**"http://**html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Please note, I am quoting the gentleman from that website.




回答2:


I had the same problem. I solved it by downloading and referencing an updated version of Modernizr here http://www.modernizr.com/ - I guess 2.0 just doesn't cut it anymore :)




回答3:


If you're using IE8 or earlier, you'll need to use HTML5 Shiv to make IE understand the new HTML5 tags. Simply add this code to your <head> and it should work:

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->



回答4:


First of all, with HTML5 you don't need the type attribute on the script element.

Secondly, close your link stylesheet element. IE is a lot less tolerant of such things so chances are this is causing it to not see the stylesheet at all.



来源:https://stackoverflow.com/questions/7282580/html-5-boilerplate-issues-with-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!