我正在使用OpenLayers 3 API制作交互式游戏地图。我希望总共有四个面板,每侧两个(右侧为&),地图显示在中间,但地图应位于侧面板下方。 浮动,Z指数等一直困扰着我。我在这个主题上找到了一些答案,但我似乎无法将这些解决方案结合起来。在中间的OpenLayers地图上的左侧和右侧的面板
当前将侧面板和地图的CSS:
.map {
min-height: 100%;
min-width: 100%;
z-index: 0;
padding: 0px 0px 0px 0px;
}
.sidebar {
z-index:9999;
background-color: #f2f2f2;
width: 20%;
margin: 1% 1% 1% 1%;
padding: 1% 1% 1% 1%;
outline: none;
border-style: solid;
border-width: 3px;
border-radius: 2px;
border-color: #9ecaed;
box-shadow: 0 0 10px #9ecaed;
}
.right { float: right; }
.left { float: left; }
3倍的DIV的HTML:
<div id="map" class="map"></div> <!-- Map, DIV that goes in the middle -->
<!-- Left sidebars -->
<div class="sidebar left">
I removed the content so it is shorter
</div>
<div class="sidebar left" style="padding-top: 0px; height: 50%;">
I removed the content so it is shorter
</div>
<!-- Right sidebars -->
<div class="sidebar right">
I removed the content so it is shorter
</div>
<div class="sidebar right" style="padding-top: 0px; height: 50%;">
I removed the content so it is shorter
</div>
我一直在尝试这种answer,但结果是可怕的。
我编辑了我的问题,现在包含HTML – triankle