zoukankan      html  css  js  c++  java
  • CSS调整DIV最小高度问题

    //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="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为准。

    
    
  • 相关阅读:
    新的知识点
    知识点
    9.14知识点
    列表内容
    css的背景和边框
    css的text和font
    css
    js 第一天
    浏览器的差距
    布局
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/2999595.html
Copyright © 2011-2022 走看看