I have a div which shows a map and which spans all the 12 column but the height is 50vh. I am trying to add two more div
below that but I don't know why it is overlapping. I have a z-index:0
on the mapDiv and z-index:1
on my navbar. Can someone point out the mistake. I already tried adding the z-index to my other two divs still no luck.
.mapDiv {
position: absolute;
z-index: 0;
background-color: black;
height: 50vh;
width: 100%;
}
.formDiv {
z-index: 0;
background-color: black;
height: 50vh;
}
.addressDiv {
z-index: 0;
background-color: crimson;
height: 50vh;
}
.navbar
{
z-index:1;
position:absolute;
}
<div class="container-fluid">
<div class="row">
<div class="col col-md-12 mapDiv" id="maps">
<div class="img-fluid map-res">
<script>
var map;
function initMap() {
var myLatLng = {
lat: 0
, lng: 0
};
var map = new google.maps.Map(document.getElementById('maps'), {
zoom: 16
, center: myLatLng
, mapTypeControl: true
, mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
, position: google.maps.ControlPosition.TOP_RIGHT
}
, });
var marker = new google.maps.Marker({
position: myLatLng
, map: map
, title: 'title!'
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=API&callback=initMap" async defer>
</script>
</div>
</div>
</div>
<div class="row">
<div class="col col-md-6 formDiv"></div>
<div class="col col-md-6 addressDiv"></div>
</div>
</div>