2013-06-28 79 views
1

儘管設置了IE瀏覽器的min-height,但我無法設置我的DIV的100%高度。下面分別是CSS和HTML。截圖也附上。IE10最小高度不起作用

正如你可以看到,左邊的滾動條上不顯示100%

enter image description here

CSS

body 
{ 
    margin:0;padding:0; 
    min-height:100%; 
    height:100%; 
} 
#container 
{ 
    background-color: "#FFF"; 
    width:100%; 
    margin: 1%; 
    overflow:auto; 
    min-height:100%; 
    height:100%; 

} 
#tree_register_abwab 
{ 
    width: 30%; 
    float: right; 
} 
#content 
{ 
    float: right; 
    margin-right: 1%; 
    overflow-y:scroll; 
    width: 60%; 
    min-height:100%; 
    height:100%; 
} 
.dynatree-title{ 
    font-size: 15px !important; 
    font-style:normal; 
    font-family: Arial !important; 
    font-weight:100; 
} 
.question 
{ 
    font-style:normal; 
    color:blue; 
    font-family:"Jameel Noori Nastaleeq"; color: rgb(191,22,38); font-size:15pt; 
} 
.answer 
{ 
    font-style:normal; 
    color:blue; 
    font-family:"Jameel Noori Nastaleeq"; color:rgb(0,0,0); font-size:15pt; 
    margin-top: 2%; 
    display: block; 
} 
#pdficon 
{ 
    margin-right: 1%; 
} 
.bold{font-weight:bold;font-size: 18pt;} 

HTML

<html dir=rtl> 
    <head> 
     <title></title> 
     <meta http-equiv="X-UA-Compatible" content="IE=10"> 
     <meta charset="utf-8" > 
     <link href="ui.dynatree.css" rel="stylesheet" type="text/css" /> 
     <link href="tree-custom.css" rel="stylesheet" type="text/css" /> 
     <LINK REL=StyleSheet HREF="search.css" TYPE="text/css" MEDIA=all /> 
     <script src = "jquery-1.8.3.min.js"></script> 
     <script src="jquery-ui.custom.min.js" type="text/javascript"></script> 
     <script src="jquery.cookie.js" type="text/javascript"></script> 
     <script src="jquery.dynatree.js" type="text/javascript"></script> 
     <script src="search.js" ></script> 
    </head> 
    <body> 
     <div id="container"> 
      <div id="tree_register_abwab"></div> 
      <div id="content"> 
       <span id="question" class="question bold"> 
       </span> 
       <span id="pdficon"><a title=" " href="#"><img src="pdf_icon.png" border="0" /></a></span> 
       <span id="answer" class="answer"> 
       </span> 
      </div> 
     </div> 
    </body> 
</html> 

回答

1

通過CSS的主體部分改變添加html CSS文件的頂部:

html, body 
{ 
    margin:0;padding:0; 
    height:100%; 
} 

您還可以刪除所有已設置爲height:100%應覆蓋它的min-height屬性。

+0

只是因爲我沒有包含HTML標記IE跳過了嗎?真? – Volatil3

+1

是!它在幾個月前絆倒了我,同時在IE中測試應用程序。 – Josh

0

IE完全忽略最小高度屬性,而不是將高度聲明爲最小高度(去圖!)。

關鍵是要設置

height: auto !important; 

你在設置你的最小高度的元素。

如:

.element { 
min-height: 100px; 
height: auto !important; 
} 

注:我想這個圖像元素,因人而異的。