一、CSS HACK     
      以下两种方法几乎能解决现今部分HACK.
完美兼容ie 6 ie7 firefox1!important 
完美兼容ie 6 ie7 firefox
完美兼容ie 6 ie7 firefox随着IE7对
!important的支持, !important 方法现在只针对IE6的HACK. 
完美兼容ie 6 ie7 firefox(注意写法.记得该声明位置需要提前.) 
完美兼容ie 6 ie7 firefox#wrapper 
二、万能 float 闭合(非常重要!)
完美兼容ie 6 ie7 firefox关于 clear float 的原理可参见 [How To Clear Floats Without Structural Markup] 
完美兼容ie 6 ie7 firefox将以下代码加入Global CSS 中,给需要闭合的div加上 
class=”clearfix” 即可,屡试不爽. 
三、其他兼容技巧(再次啰嗦)
完美兼容ie 6 ie7 firefox1, FF下给 div 设置 padding 后会导致 width 和 height 增加, 但IE不会.(可用!important解决)
完美兼容ie 6 ie7 firefox
2, 居中问题.
完美兼容ie 6 ie7 firefox
1).垂直居中.将 line-height 设置为 当前 div 相同的高度, 再通过 vertical-align: middle.( 注意内容不要换行.)
完美兼容ie 6 ie7 firefox
2).水平居中. margin: 0 auto;(当然不是万能)
完美兼容ie 6 ie7 firefox
3, 若需给 a 标签内内容加上 样式, 需要设置 display: block;(常见于导航标签)
完美兼容ie 6 ie7 firefox
4, FF 和 IE 对 BOX 理解的差异导致相差 2px 的还有设为 float的div在ie下margin加倍等问题.
完美兼容ie 6 ie7 firefox
5, ul 标签在 FF 下面默认有 list-style 和 padding . 最好事先声明, 以避免不必要的麻烦. (常见于导航标签和内容列表)
完美兼容ie 6 ie7 firefox
6, 作为外部 wrapper 的 div 不要定死高度, 最好还加上 overflow: hidden.以达到高度自适应.
完美兼容ie 6 ie7 firefox
7, 关于手形光标. cursor: pointer. 而hand 只适用于 IE.


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2022-01-05
猜你喜欢
  • 2021-11-29
  • 2021-09-08
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-01-16
相关资源
相似解决方案