css - Bootstrap 2.3.2 干扰 Google map 控件 v.3

标签 css google-maps twitter-bootstrap google-maps-api-3

我是 bootstrap twitter 的新手,我的版本是 2.3.2,在将谷歌地图纳入我的网站后,谷歌地图控件变得不可见,我搜索了这个问题,但我发现它对我不起作用: 这段代码修复了控件的布局,但它们仍然不可触摸

#map-canvas img { max-width: none ; max-height:none; }
#map-canvas label { width: auto; display: inline; }

右侧的下拉菜单也变形了

<div class="span9">
 <div id="map-canvas"></div>
</div>

enter image description here

最佳答案

来自 Bootstrap 文档 (http://getbootstrap.com/getting-started/#third-parties):

If you're using Google Maps on a Bootstrapped project, you might run into some display problems due to our use of * { box-sizing: border-box; }. Previously, you may have also ran into issues with the use of max-width on images. The following snippet should avoid all those problems.

 /* Fix Google Maps canvas
 *
 * Wrap your Google Maps embed in a `.google-map-canvas` to reset Bootstrap's
 * global `box-sizing` changes. You may optionally need to reset the `max-width`
 * on images in case you've applied that anywhere else. (That shouldn't be as
 * necessary with Bootstrap 3 though as that behavior is relegated to the
 * `.img-responsive` class.)
 */

.google-map-canvas,
.google-map-canvas * { .box-sizing(content-box); }

/* Optional responsive image override */
img { max-width: none; }

关于css - Bootstrap 2.3.2 干扰 Google map 控件 v.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19048329/

相关文章:

javascript - 如何使用 AngularJS 获得没有滚动条大小的宽度?

css - 在 Angular 中将通用 CSS 放在哪里

ios - iPhone 3.0 SDK 中的 MAP 使用有哪些限制?

ios - Google Directions API 无法在 iOS 中返回结果

html - Bootstrap 列不起作用

django - 在 Bootstrap 中使单击的选项卡处于事件状态

html - 使用流畅的创建固定高度的水平 div

css - 如何使用 css 样式表在我的 html 页面中获取文本以显示功能?

Android:Google Maps V2:我们如何获取屏幕的经度/纬度?

jquery - Bootstrap Accordion 不会折叠之前显示的 div