我的问题是关于有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'。那么问题是什么? –