DIV里可以不填任何内容

div.space {
        height: 2px;
        font-size: 0;
}

<div class="space"></div>
 


第二种方法:

跳过IE6中对font-size的限定,使用line-height来进行定义,但是DIV里面必须填写内容,如果没有内容,用替换。

div.space {
        line-height: 2px;
}

<div class="space"></div>
 

该文章转摘自-网页制作大宝库(http://www.dabaoku.com/) - 原文链接:http://www.dabaoku.com/jiaocheng/wangye/css/200911083023.shtml

相关文章:

  • 2022-01-10
  • 2021-11-12
  • 2022-12-23
  • 2021-12-23
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
猜你喜欢
  • 2021-06-27
  • 2022-01-28
  • 2021-11-27
  • 2021-11-03
  • 2022-12-23
  • 2021-07-16
  • 2021-12-21
相关资源
相似解决方案