我的問題是關於有2個div有85%的高度和100%的寬度,但只能一次顯示一個。現在是第二個div顯示奇怪。多個div如何具有85%的高度和100%的寬度?
看看這裏,然後選擇(menuslider->選擇下籤證「格拉夫」。) 在那裏,你將看到第二個div不具有寬度100%和85%的高度,我可以在一個簡單的解決這個問題辦法?
下面是HTML:
<div id="mainContent">
<div id="googleMap"></div>
<div id="GraphWindow">dw
<iframe src="prototype.html" frameborder="" name="" width="" height="" scrolling="no"> Sorry your browser does not support frames or is currently not set to accept them.</iframe>
</div>
</div>
這裏是CSS:
html {height:100%}
body {height:100%;margin:0;padding:0}
#mainContent{
height:85%;
width:100%;
margin-left: auto ;
margin-right: auto ;
}
#graphWindow{
height:85%;
width:100%;
margin-left: auto ;
margin-right: auto ;
}
#googleMap {
height:85%;
width:100%;
margin-left: auto ;
margin-right: auto ;
}
這裏是JavaScript顯示或隱藏的圖形:
function selectMainView(){
if(document.details.title.value == "map"){
document.getElementById("googleMap").style.display = "block";
document.getElementById("GraphWindow").style.display = "none";
}
else{
document.getElementById("googleMap").style.display = "none";
document.getElementById("GraphWindow").style.display = "block";
}
}
解決什麼?你從來沒有真正說出你想要的。 – Sparky
我只有Map時才能看到Map,而當我點擊Graph時只有'GraphWindow'。那麼問題是什麼? –