ie7 下的hack
ie7发布了,有很多方法用不了了
但是ie7有了一个全新的hack

  1. *+html ie7{
  2.  
  3. }

在里面加上要hack的代码就可以只有在ie7下生效

对于一般网站来说,在ie7下最普遍的问题就是浮动层的
layout失效的问题造成。通常情况下在ie6和firefox下用的
hack代码是

  1. .clearfix:after {
  2.         content: ".";
  3.         display: block;
  4.         height: 0;
  5.         clear: both;
  6.         visibility: hidden;
  7.     }
  8.     * html>body .clearfix {
  9.         display: inline-block;
  10.         width: 100%;
  11.     }
  12.    
  13.     * html .clearfix {
  14.         /* Hides from IE-mac \*/
  15.         height: 1%;
  16.         /* End hide from IE-mac */
  17.     }

但是这个hack在ie7下是失效的
我们之需要在这段代码增加一个ie7的hack就可以解决问题了

  1. .clearfix:after {
  2.         content: ".";
  3.         display: block;
  4.         height: 0;
  5.         clear: both;
  6.         visibility: hidden;
  7.     }
  8.     * html>body .clearfix {
  9.         display: inline-block;
  10.         width: 100%;
  11.     }
  12.    
  13.     * html .clearfix {
  14.         /* Hides from IE-mac \*/
  15.         height: 1%;
  16.         /* End hide from IE-mac */
  17.     }
  18.        /* ie7 hack*/
  19.         *+html .clearfix {
  20.         min-height: 1% ;
  21.     }

最后感谢~~~realazy http://realazy.org/blog/ 在我遇到问题的时候可以耐心的给我解答