---
title: "css hack"
author: "luoke920"
date: "2012-03-01T18:05:18Z"
tags: []
categories: ["互联网"]
slug: "css-hack"
draft: false
lastmod: "2012-03-01T18:05:18Z"
id: 1434609
url: "https://luoke920.iteye.com/blog/1434609"
---

**&lt;style&gt;**    
    **#test**     
    **{**     
        **width:300px;**     
        **height:300px;**     
            
        **background-color:blue;      /\*firefox\*/**  
        **background-color:red\\9;      /\*all ie\*/**  
        **background-color:yellow\\0;    /\*ie8\*/**  
        **+background-color:pink;        /\*ie7\*/**  
        **\_background-color:orange;       /\*ie6\*/**  
    **}**    
    **:root #test { background-color:purple\\9; }  /\*ie9\*/**  
    **@media all and (min-width:0px){ #test {background-color:black\\0;} }  /\*opera\*/**  
    **@media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;} }  /\*chrome and safari\*/**  
    **&lt;/style&gt;**