2015-07-21 114 views
0

我有2個div像一列。現在的問題是,正確的div比左邊的div高。爲什麼?我想用百分比工作。safari - 不同的計算div百分比

我只有這個問題在safari

我希望有人能幫助我。我不明白這個問題。

<!DOCTYPE html> 
<html lang = "de"> 
    <head> 
     <meta charset = "utf-8"> 
     <link rel = "stylesheet" href = "./css/smartphone/480.css" media = "screen and (min-device-width: 1px) and (max-device-width: 480px)"> 
     <link rel = "stylesheet" href = "./css/smartphone/1024.css" media = "screen and (min-device-width: 481px) and (max-device-width: 1024px)"> 
     <link rel = "stylesheet" href = "./css/desktop/desktop.css" media = "screen and (min-device-width: 1025px)"> 

    </head> 
    <body> 
       <div id = "links"> 
        <div style = "height:20%; background-color:#ECECEC;"> 
        </div> 
        <div style = "height: 15%; background-color:#2DAB66;"> 
        </div> 
        <div style = "height: 16%; background-color:#ECECEC;"> 
        </div> 
        <div style = "height: 15%; background-color:#1E788B;"> 
        </div> 
        <div style = "height: 34%; background-color:#ECECEC;"> 
        </div> 
       </div> 

       <div id = "mitte" > 

       </div> 

    </body> 

</html> 

CSS:

body { 
    /*margin-top: 1%; 
    background-color: white; 
    width: auto; 
    height: 95%; 
    min-height: 95%;*/ 
    background-color: #3C3C3B; 
} 


#links { 
    width:13%; 

    min-height:95%; 
    height: auto; 
    height: 95%; 
    position: absolute; 
    float: left; 
    left: 12.1%; 
} 

#mitte { 
    left: 25%; 
    width: 50%; 
    max-height:95.0%; 
    height: auto; 
    height: 95.0%; 
    position: absolute; 
    background-color: white; 
} 

回答

0

這可能與瀏覽器的默認樣式做。嘗試在自定義樣式之前添加reset.css文件,並查看是否修復了該文件。

另外,請用你的意思是「中間格」

+0

是的,我看到至少有30'div's –

+0

檢查這個網站看看問題http://www.benwillgruber.com更清楚什麼/ neueSeite /使用Safari和ie進行嘗試。你可以看到不同的。野生動物園中的中位數更高 –