正常的代码是这样的:
#daima { width:250px; height:200px; border:1px solid #999; background:#fff; margin:10px;}
(出来效果是这样的):
边距明明定的是10PX出来的却是20PX;
修正代码是这样的:
#daima { width:250px; height:200px; border:1px solid #999; background:#fff; margin:10px!important; margin:5px;}
此处需要注意的是:IE6只识别最后一个属性,换句话说,如果你把margin:5px;写到margin:10px !important;前面的话,IE6也是识别不了没有任何效果的。注意啦!
(出来效果是这样的):
嗯哼,要的就是这效果
!important
是写给
IE7
和
FF
的。因为IE6是不认识
!important
的
再来看一下两个图的对比
好啦~ 是不是很简单咧~~