ie7 下的hack
1 3, 2007
作者: xw | 分类: Web 标准
ie7 下的hack
ie7发布了,有很多方法用不了了
但是ie7有了一个全新的hack
在里面加上要hack的代码就可以只有在ie7下生效
对于一般网站来说,在ie7下最普遍的问题就是浮动层的
layout失效的问题造成。通常情况下在ie6和firefox下用的
hack代码是
- .clearfix:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
- * html>body .clearfix {
- display: inline-block;
- width: 100%;
- }
-
- * html .clearfix {
- /* Hides from IE-mac \*/
- height: 1%;
- /* End hide from IE-mac */
- }
但是这个hack在ie7下是失效的
我们之需要在这段代码增加一个ie7的hack就可以解决问题了
- .clearfix:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
- * html>body .clearfix {
- display: inline-block;
- width: 100%;
- }
-
- * html .clearfix {
- /* Hides from IE-mac \*/
- height: 1%;
- /* End hide from IE-mac */
- }
- /* ie7 hack*/
- *+html .clearfix {
- min-height: 1% ;
- }
最后感谢~~~realazy http://realazy.org/blog/ 在我遇到问题的时候可以耐心的给我解答
发表评论