IE6 / IE7 / Firefox 的margin问题解决办法

这两天在做一个网站的布局,因为经常用firefox,所有的内容都是在firefox下面调试的,等快完工了切回IE7一看,样式差别好多,主要是在margin,padding这几个元素的理解上。
我知道ie6 ie7 firefox 对margin的解释都不同,去网上查了一下,可以通过!important这样的手段hack。
具体的做法有以下几种:
第一种:
.div {
  background:orange;/*ff*/
  *background:green !important;/*ie7*/
  *background:blue; /*ie6*/
}
第二种:
.div {
  margin:10px;/*ff*/
  *margin:15px;/*ie7*/
  _margin:15px;/*ie6*/
}
第三种:
#div { color: #333; } /* ff */
* html #div { color: #666; } /* IE6 */
*+html #div { color: #999; } /* IE7 */

现在常用了第一种,很好用,写出来与大家分享。
在给一个例子:
#pages{margin:auto; 910px; text-align:left; }
#pages{*915px !important;}   /* IE7 */
原文地址:https://www.cnblogs.com/zzh/p/1283310.html