CSS Div 最小高度在IE 6 和IE 7中的相容性問題

來源:互聯網
上載者:User

瀏覽器安全色問題-CSS Div 最小高度在IE 6 和IE 7中的相容性問題

用CSS 的定義一個DIV的高度時,在IE 7瀏覽器下可以正常顯示。但是在IE 6 中,height 在10px以下就無法定義了。這點跟表格有點類似。解決的方法如下:

法一:定義overflow屬性。比如想定義一個高度為2px 的線條。
<div style="height:2px;overflow:hidden;background:#000000;width:778px;"></div> 法二:將div 的字型大小屬性fontsize 設定為跟高度相同。
<div style="height:2px;font-size:2px;background:#000000;width:778px;">&nbps;</div>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.