需求,html底部为地图,上层是各个div
HTML
<body> //地图 <div id='map' id="demo1"></div> <div class="middleTop" id="demo2"> </div> </body>
css样式 .middleTop { width: 100%; height: 8%; position: absolute; top: 1px; text-align: center; background: #00065b; }
至此,demo2div就在demo1的上层了。