以height屬性爲例:
1.ff和各個版本ie的區別與順序
.myheight{
height:100px; /* ff,默認的爲ff屬性值 */
height:98px\0; /* ie8 */
*height:95px; /* ie7 */
_height:96px; /* ie6 */
}
若ie6、7的屬性值一樣,那麼寫法如下
.myheight{
height:100px; /* ff */
height:98px\0; /* ie8 */
+height:95px; /* ie6、ie7 */
}
2.ff和ie(包含各個版本ie)的區別與順序
.myheight{
height:100px; /* ff */
height:96px\9; /* ie */
}
3.!important
.myheight{
height:100px!important; /* 除ie6以外的所有瀏覽器的屬性值 */
height:94px; /* ie6 */
}
原理:ie6不支持“!important”規範
其他的推薦寫法:引至http://www.css88.com/archives/1681
.test{
color:#000000; /* FF,OP支持 */
color:#0000FF\0; /* IE8支持*/
[color:#000000;color:#00FF00; /* SF,CH支持 */
*color:#FFFF00; /* IE7支持 */
_color:#FF0000; /* IE6支持 */
}