CSS没有链接到IE 7和IE 8中的HTML

时间:2022-11-22 19:16:39

I'm creating a responsive website using several stlyesheets. Everything works fine in IE 9, Firefox and Safari, but the when I view the site in IE 8 or below, the styles disappear.

我正在使用几个stlyesheets创建一个响应式网站。在IE 9,Firefox和Safari中一切正常,但是当我在IE 8或更低版本中查看网站时,样式消失了。

You can view the site at http://stevepolitodesign.comlu.com/ (I am hosting it for free for debugging purposes, so it may be down periodically)

您可以在http://stevepolitodesign.comlu.com/上查看该网站(我正在免费托管它以进行调试,因此可能会定期关闭)

Here is the HTML

这是HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Steve Polito Design</title>

<!-- CSS -->
<link href="css/wide.css" rel="stylesheet" type="text/css" media="screen and (min-width: 1501px)" />
<link href="css/layout.css" rel="stylesheet" type="text/css" media="screen and (min-width: 801px) and (max-width: 1500px)" />
<link href="css/medium.css" rel="stylesheet" media="screen and (min-width: 401px) and (max-width: 800px)" />
<link href="css/narrow.css" rel="stylesheet" media="screen and (min-width: 0px) and (max-width: 400px)" />
<link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)" type="text/css" href="css/iphone.css"/>
<link href="css/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css"  media="screen"/>


<!-- @font-face -->
<link href="fonts/@font-face.css" rel="stylesheet" type="text/css" />

<!-- JS -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="js/site.js"></script>


</head>  

1 个解决方案

#1


0  

The media attribute is part of CSS3 and is therefore not supported by IE 6/7/8. See this article, http://nicolasgallagher.com/mobile-first-css-sass-and-ie/, for more information about it.

media属性是CSS3的一部分,因此IE 6/7/8不支持。有关它的更多信息,请参阅此文章http://nicolasgallagher.com/mobile-first-css-sass-and-ie/。

The quick solution is to add some lines that link to css files that are hidden to all but IE6-8.

快速解决方案是添加一些链接到css文件的行,这些文件对IE6-8以外的所有文件都是隐藏的。

<!--[if (gt IE 8) | (IEMobile)]><!-->
<link rel="stylesheet" href="/css/style.css">
<!--<![endif]-->

#1


0  

The media attribute is part of CSS3 and is therefore not supported by IE 6/7/8. See this article, http://nicolasgallagher.com/mobile-first-css-sass-and-ie/, for more information about it.

media属性是CSS3的一部分,因此IE 6/7/8不支持。有关它的更多信息,请参阅此文章http://nicolasgallagher.com/mobile-first-css-sass-and-ie/。

The quick solution is to add some lines that link to css files that are hidden to all but IE6-8.

快速解决方案是添加一些链接到css文件的行,这些文件对IE6-8以外的所有文件都是隐藏的。

<!--[if (gt IE 8) | (IEMobile)]><!-->
<link rel="stylesheet" href="/css/style.css">
<!--<![endif]-->