对于IE6及以下版本的处

判断IE6 CSS 通过判断浏览器类型而加载不同的css样式

所有IE都起作用:

<!--[if IE]>  <link rel="stylesheet" type="text/css" href="all-ie-only.css/> <![endif]-->

IE以外浏览器起作用:

<!--[if !IE]><!-->  <link rel="stylesheet" type="text/css" href="not-ie.css" /> <!--<![endif]-->

只有IE7起作用:

<!--[if IE 7]>  <link rel="stylesheet" type="text/css" href="ie7.css"> <![endif]-->

只有IE6起作用:

<!--[if IE 6]>  <link rel="stylesheet" type="text/css" href="ie6.css"/> <![endif]-->

只有IE5起作用:

<!--[if IE 5]>  <link rel="stylesheet" type="text/css" href="ie5.css"/> <![endif]-->

只有IE5.5起作用:

<!--[if IE 5.5000]>  <link rel="stylesheet" type="text/css" href="ie55.css"/> <![endif]-->

只对IE6及以下版本起作用:

<!--[if lt IE 7]>  <link rel="stylesheet" type="text/css" href="ie6-and-down.css"/> <![endif]-->
<!--[if lte IE 6]>  <link rel="stylesheet" type="text/css" href="ie6-and-down.css"/> <![endif]-->

只对IE7及以下版本起作用:

<!--[if lt IE 8]>  <link rel="stylesheet" type="text/css" href="ie7-and-down.css"/> <![endif]-->
<!--[if lte IE 7]>  <link rel="stylesheet" type="text/css" href="ie7-and-down.css"/> <![endif]-->

只对IE8及以下版本起作用:

<!--[if lt IE 9]>  <link rel="stylesheet" type="text/css" href="ie8-and-down.css"/> <![endif]-->
<!--[if lte IE 8]>  <link rel="stylesheet" type="text/css" href="ie8-and-down.css"/> <![endif]-->

只对IE6及以上版本起作用:

<!--[if gt IE 5.5]>  <link rel="stylesheet" type="text/css" href="ie6-and-up.css"/> <![endif]-->
<!--[if gte IE 6]>  <link rel="stylesheet" type="text/css" href="ie6-and-up.css"/> <![endif]-->

只对IE7及以上版本起作用:

<!--[if gt IE 6]>  <link rel="stylesheet" type="text/css" href="ie7-and-up.css"/> <![endif]-->
<!--[if gte IE 7]>  <link rel="stylesheet" type="text/css" href="ie7-and-up.css"/> <![endif]-->

只对IE8及以上版本起作用:

<!--[if gt IE 7]>  <link rel="stylesheet" type="text/css" href="ie8-and-up.css"/> <![endif]-->
<!--[if gte IE 8]>  <link rel="stylesheet" type="text/css" href="ie8-and-up.css"/> <![endif]-->

三、通常对IE6做这样处理:
(本站就是这样处理)
对于IE6及以下版本处理是很具有挑战性.近来,人们都在呼吁对IE6要太在意,包括一些企业,一些网络应用,甚至是政府。现在有一个比让这些在 IE6下让人惨忍睹网站下地域更好解决方案,那就是单独写一个针对IE6精简CSS样式表,这样至少会影响人们浏览网页主要内容。然后再写一个IE6以上版本及其它浏览器正常CSS,这样是很好?

<!--[if !IE 6]><!-->   <link rel="stylesheet" type="text/css" media="screen, projection" href="REGULAR-STYLESHEET.css" /> <!--<![endif]-->   <!--[if gte IE 7]>   <link rel="stylesheet" type="text/css" media="screen, projection" href="REGULAR-STYLESHEET.css" /> <![endif]-->   <!--[if lte IE 6]>   <link rel="stylesheet" type="text/css" media="screen, projection" href="http://universal-ie6-css.googlecode.com/files/ie6.0.3.css" /> <![endif]-->

四、如果你非要用HACK来解决话……请往下看
只对IE7起作用:

* html #div {     height: 300px; }

对非IE7起作用:

#div {     _height: 300px; }

只对IE6以上版本起作用:

#div {    height/**/: 300px; }
html->body #div {       height: 300px; }
时间: 2024-08-11 09:54:20

对于IE6及以下版本的处的相关文章

CSS3 Pie工具可以让IE6至IE8版本实现大多数的CSS3修饰特性,如圆角、阴影、渐变等

css3 pie使用方法: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .style{ border: 1px solid #669966; padding: 60px 0pt; text-align: center; width: 200

IE5,IE6,IE7多版本共存JavaScript调试工具

web标准很重要的一点也是最烦的一点,特别是要兼容各版本浏览器,随着微软IE7的推出,在网页设计时需要同时考虑兼容ie7前面的IE5/IE5.5/IE6版本,之前一直没有找到好的方法,最近终于找到IE版本合集软件包Multiple_IE.严重推荐给大家,大家升级到IE7后也可方便测试网页的兼容性. 过多的浏览器给 Web 开发造成了困难,颇有抱怨的味道.不过抱怨归抱怨,对于安装有 IE7 的电脑,除非卸载 IE7,否则只能靠虚拟机的方式来运行 IE 的其它版本.有了 Multiple IE 就可

兼容ie6及一下版本的自适应

<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=9" /> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --&

关于IE6中做兼容的那点事。

前言 对于程序员来说,一听到你做的程序必须兼容IE6(当然主流浏览器肯定得兼容的),那颗滚烫的心瞬间哇凉哇凉的,但是有时,项目就要求这样,你也只能硬着头皮跟IE6来个亲密接触,最近正好做了个项目,关于兼容IE6,真是废了点功夫,特此记录一下,方便以后查阅,也方便以后园友遇到同样问题可以参考一下. 正文 I.png透明图片不支持透明. 简介:项目中运用一部分png图片,在IE7以上,火狐,谷歌均是正常显示,但在IE6中,PNG图片背景出现差异,有时纯黑,有时纯白,有时纯灰等等,而不是透明,经过一番

关于IE6的一些常见的CSS BUG处理

CSS BUG:样式在各浏览器中解析不一致的情况,或者说CSS样式在浏览器中不能正确显示的问题称为CSS BUG: CSS Hack:css hack是指一种兼容css 在不同浏览器中正确显示的技巧方法,因他们都属于个人对css代码的非官方的修改,或非官方的补丁. 使用Hack的一些副作用:降低了css代码的可读性,增加了代码的负担 今天跟大家分享下关于IE6一些常见的BUG处理: (1)图片间隙: a)div中的图片间隙(该BUG出现在IE6及更低版本中) 描述:在div中插入图片时,图片会将

作业总结(一):IE6下面的那些坑

考完试就来实习的公司实习了,大概最近有两周时间就一直在做公司给新人布置的大作业.虽然只是很简单的一个小的项目,但却从其中总结到了不少有用的东西.计划将其发出来一系列文章,算是对这两周时间的总结.也算是在这里留下记录,防止以后坑在同一个地方,接下来几周没事持续填坑吧. 在没来公司之前,我做过的项目也好,学习的新技术也好.从来都没有去想过去兼容IE6及以下版本的浏览器的,之前一段时间淘宝刚宣布不再继续支持IE6,刚好我做大作业的时候,百度也宣布不再继续支持IE6.但是来了公司之后接到的新人大作业之后

判断IE版本的HTML语句详解,如:[if lte IE 9]……[endif]

我们常常会在网页的HTML里面看到形如[if lte IE 9]--[endif]的代码,表示的是限定某些浏览器版本才能执行的语句,那么这些判断语句的规则是什么呢?请看下文: <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--><!--[if IE]> 所有的IE可识别 <![endif]--><!--[if IE 6]> 仅IE6可识别 <![endif]--><!--[i

IE下判断IE版本语法使用

先摆一下判断IE版本语法 <!--[if lte IE 6]> <![endif]--> IE6及其以下版本可见 <!--[if lte IE 7]> <![endif]--> IE7及其以下版本可见 <!--[if IE 6]> <![endif]--> 只有IE6版本可见 <![if !IE]> <![endif]> 除了IE以外的版本 <!--[if lt IE 8]> <![endif

css HACK之浏览器版本判断【转】

<!--[if lte IE 6]> <![endif]--> IE6及其以下版本可见 <!--[if lte IE 7]> <![endif]--> IE7及其以下版本可见 <!--[if IE 6]> <![endif]--> 只有IE6版本可见 <![if !IE]> <![endif]> 除了IE以外的版本 <!--[if lt IE 8]> <![endif]--> IE8以下