css划隔横线的两种方法

  方法一:用DIV,代码如下:(推荐此方法)

    <div style="width:800px;height:1px;margin:0px auto;padding:0px;overflow:hidden;"></div>

    说明:上面代码中的红色部分overflow:hidden;很重要,如果不加这句的话,在IE6下高度将会被拉的很开。


    方法二:用HR,代码如下:

    <hr style="margin:0px;height:1px;border:0px;color:#D5D5D5;"/>

  方法二HR的方法,在IE6下总是在高度方面,上面总是空了一点距离?

相关文章:

  • 2022-01-14
  • 2022-12-23
  • 2021-10-20
  • 2022-01-20
  • 2021-10-10
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
相关资源
相似解决方案