CSS hack notes

记下�备查,�断增加中。�得�次去找了。

IE中模拟position:fixed效果,最好和�件注释��使用
html, body{
height: 100%;
overflow: auto;
}
div.fixed {
position: absolute;
}

�件注释:
<!--[if lt IE 7]>
<link rel="stylesheet" href="ie.css" type="text/css" />
<![endif]-->

这个是clear float元素的方法:
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {display: inline-table;}
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */

�有IE/Win ��的写法:
/* Holly Hack: Hide From IE5/Mac \*/
* html .yourclass {
}
/* Holly Hack: End Hide From IE5/Mac */

修正IEwin的3px margin bug,适用于两列并排的情况
#floatbox {
float: left;
width: 123px;
}
p{
margin-left:123px;/* for none IE/win browsers */
}
/*\*/
* html #floatbox {
margin-right:-3px;
}
* html p {
height: 1%;
margin-left: 0;
}
/**/
* html #floated-image {
/* if the floater itselft is a image or other replaced element */
margin: 0 -3px; ma\rgin: 0;
}

IE5/Win Only Styles
/* IE5/Win Only Styles
----------------------------------------------- */
@media tty {
i{content:"\";/*" "*/}} @import url('ie5win.css'); /*";}
}/* */

Leave a Comment