CSS調整DIV最小高度問題

來源:互聯網
上載者:User
//JS代碼部分: var isShowFlag = 1;//是否顯示function isShowDet(){if(isShowFlag == 0){document.getElementById("queryDeatilDIV").style.display='';isShowFlag = 1;}else{document.getElementById("queryDeatilDIV").style.display='none';isShowFlag = 0;}}  //  body部分:<div id="showDiv" align="center" style="font-size:1px;"><input id="showFlag" type="button" style="width:100px;height:7px;"  onclick="isShowDet();">  </div><div id="queryDeatilDIV"> <iframe  name="iframe1" width="100%" height="190" frameborder="0" scrolling="auto"></iframe></div>假如div裡有內容,即有元素,那麼div預設有一個最小高度,這個是瀏覽器預設文字(應該是)高度,如果div沒有設定屬性font-size:10px;那麼該div最小的高度則是瀏覽器預設文本高度,反之,則是以font-size為準。

相關文章

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.