【发布时间】:2016-06-01 07:49:21
【问题描述】:
我尝试让谷歌 iframe 地图具有响应性,但在移动设备上查看时,地图的大小保持不变,而不是调整大小。我已尝试多次替换代码(基于此处找到的答案),但没有找到解决我的问题的方法。如果有人能指出我的错误,将不胜感激。
/* Google Map */
.google-maps {
position: relative;
padding-bottom: 75%; // This is the aspect ratio
height: 0;
overflow: hidden;
}
.google-maps iframe {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
}
HTML
<div class="col-lg-6 col-md-6 col-sm-12" class="google-maps">
<iframe src="https://www.google.com/maps/d/embed?mid=1vQ8RDv0RplunNZfvdhgPTtCSjGA" width="600" height="450" frameborder="0" style="border:0"></iframe>
【问题讨论】:
标签: twitter-bootstrap google-maps iframe