---
title: "ie6,ie9 css hack"
author: "yunmoxue"
date: "2012-02-03T10:19:41Z"
tags: []
categories: ["Web前端"]
slug: "ie6-ie9-css-hack"
draft: false
lastmod: "2012-02-03T10:19:41Z"
id: 1391941
url: "https://ymx.iteye.com/blog/1391941"
---

```
/*ie6 only*/
body{

  _background:blue;

}


/*ie9 only*/
:root body{

  background:gray\0;

}
 
```

----------ie9-------------------

:root 是 css3的写法

\\0 是为了区别其他支持css3的非ie浏览器

\\0的写法 ie8,ie9都支持,将来的ie10可能也会支持..谨慎使用..

参考资料:  
[ie6~ie9 hack 写法](http://gongxinjun.com/blog/1224.html?tn=gongxinjun.com)

[巧用CSS3属性作为CSS hack](http://www.zhangxinxu.com/wordpress/2011/08/%E5%B0%8Ftip%E5%B7%A7%E7%94%A8css3%E5%B1%9E%E6%80%A7%E4%BD%9C%E4%B8%BAcss-hack/)

[IE8的css hack](http://www.css88.com/archives/1681)

[IE9的css hack](http://www.css88.com/archives/3746)