【发布时间】:2015-10-19 21:32:24
【问题描述】:
我使用的是 Google Map API v3,但只有 IE 有问题。
我有一个带有 2 个块“table-cell”的块“table”。在表格单元格中,我有地图,但是,我没有看到地图。
问题是高度为 100% 的“gm-style”块,我们看不到地图。 如果我将高度更改 250 像素(示例),我们会看到地图。
如何使用“table”和“table-cell”块调整这个块的高度?
谢谢!
<style>
.table {
width: 100%;
display: table;
}
.table-cell {
display: table-cell;
width: 50%;
vertical-align: top;
}
</style>
<script src="//maps.googleapis.com/maps/api/js?v=3"></script>
<div class="table">
<div class="table-cell" id="map"></div>
<div class="table-cell" style="height: 250px;">
Cell 2
</div>
</div>
<script>
// Create map
map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: new google.maps.LatLng(-30, 145.5),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
</script>
【问题讨论】:
标签: javascript css internet-explorer google-maps-api-3